<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cnelson" rel="nofollow">Christian Nelson</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1274?redirect=false" rel="nofollow">SPR-1274</a></strong> and commented</p>
<p dir="auto">If the map key contains nested brackets, the key is not properly extracted from the string by BeanWrapperImpl.getPropertyNameTokens(String propertyName).</p>
<p dir="auto">For example, consider these 'paths':</p>
<ol dir="auto">
<li>"entries[some text[abc]]", key = "some text[abc" (missing ])</li>
<li>"entries['some text[abc]']", key = "'some text[abc" (missing ]')</li>
<li>"entries["some text[abc]"]", key = ""some text[abc" (missing ]")</li>
</ol>
<p dir="auto">The first one is kinda a stretch, and I didn't expect it to work.  My natural reaction was to try the second and third, thinking that grouping it would do the trick.  It didn't though.</p>
<p dir="auto">This came up in the web application I'm working on.  There's a form with let's the user assign IDs to textual names.  The name sometimes contain brackets, which triggered this issue.</p>
<p dir="auto">BeanWrapperImpl.java:610 (1.2.4 source) is the cause.  The parser could count braces, and return the key when it's found the first matching pair.  In the example above, the first ] would be part of the key, and the second, which completes the initial pair, would complete the key.  This solution would work regardless of the single or double quotes.  An alternative would be to ignore braces that are in quoted ections of the string.  This naturally would only work for scenarios <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1575150" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/2" data-hovercard-type="pull_request" data-hovercard-url="/spring-projects/spring-framework/pull/2/hovercard" href="https://github.com/spring-projects/spring-framework/pull/2">#2</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2332826" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/3" data-hovercard-type="pull_request" data-hovercard-url="/spring-projects/spring-framework/pull/3/hovercard" href="https://github.com/spring-projects/spring-framework/pull/3">#3</a> above.</p>
<p dir="auto">I will try to update BeanWrapperImpl.java with a sllightly more sophisticated bracket parser and submit a patch with tests.  If you think it's a waste of time, or if there's something obvious I'm missing, feel free to point out my error.  Regards, Christian</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.2.4</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/11129/MapBindingTests.java" rel="nofollow">MapBindingTests.java</a> (<em>2.04 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/11127/spr-1274-patch-1.txt" rel="nofollow">spr-1274-patch-1.txt</a> (<em>7.68 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/11128/spr-1274-patch-2.txt" rel="nofollow">spr-1274-patch-2.txt</a> (<em>8.51 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398068359" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6983" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6983/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6983">#6983</a> Incorrect string parsing of mapped property names (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">5 votes, 4 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=skaffman" rel="nofollow">Kenny MacLeod</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6159?redirect=false" rel="nofollow">SPR-6159</a></strong> and commented</p>
<p dir="auto">Between 3.0.0 M4 and RC1, the protected parseStrongValue method disappeared from PropertyPlaceholderConfigurer. For custom subclasses, this method was the main entry point into the superclass functionality. Since it had not been deprecated, it seemed like the correct thing to do, but has now been removed, breaking compile-time compatibility between 2.5 and 3.0.</p>
<p dir="auto">Can the method be reinstated somehow, that perhaps invokes the new methods that do the work? It can then be marked as deprecated.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC1</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398098956" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10981" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10981/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10981">#10981</a> parseStringValue gone from PropertyPlaceholderConfigurer (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">2 votes, 2 watchers</p>