<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=johndstein" rel="nofollow">john@johnandkerri.com</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4164?redirect=false" rel="nofollow">SPR-4164</a></strong> and commented</p>
<p dir="auto">I seems that form:checkboxes and form:radiobuttons are still broken.  They still use toString and not the registered property editor to generate the value.</p>
<p dir="auto">form:select works properly, and  form:checkboxes and form:radiobuttons should work just like it.</p>
<p dir="auto">For example:</p>
<p dir="auto">&lt;form:select path="interests" multiple="true"&gt;<br>
&lt;form:options  items="${interests}" itemLabel="name" itemValue="id" /&gt;<br>
&lt;/form:select&gt;</p>
<p dir="auto">The above works great. path="interests" is the complete set of things a person may be interested in and items="${interests}" are the set of things the given person is interested in.</p>
<p dir="auto">However, checkboxes and radiobuttons like so:</p>
<p dir="auto">&lt;form:checkboxes path="interests" items="${interests}" itemLabel="name" /&gt;<br>
&lt;form:checkboxes path="interests" items="${interests}" itemLabel="name" itemValue="id" /&gt;</p>
<p dir="auto">does not work.  Specifically, if I leave itemValue blank, the values are correctly bound and the right ones checked, but the tag uses toString to generate the value instead of calling the property editor, so when I save of, course, the property editor can't convert the value (unless my toString method returns the same thing as my custom property editor, which is not a good solution).</p>
<p dir="auto">If I do itemValue="id", the values are not properly bound (the right check boxes are not checked.</p>
<p dir="auto">The same issue is true with the single versions form:checkbox and form:radiobutton.</p>
<p dir="auto">&lt;c:forEach var="interest" items="${interests}"&gt;<br>
&lt;frm:checkbox path="interests" value="${interest}" /&gt;<br>
&lt;c:out value="${interest.name}" /&gt;<br>
&lt;/c:forEach&gt;</p>
<p dir="auto">The above would work if the tag used the registered property editor to generate the value, but instead it uses toString (and again, if your toString returns the same thing as your property editor, it works).</p>
<p dir="auto">This issue relates to these other issues.</p>
<p dir="auto">Allow form:checkbox to create multiple boxes based on a collection of values:<br>
<a href="http://opensource.atlassian.com/projects/spring/browse/SPR-3882" rel="nofollow">http://opensource.atlassian.com/projects/spring/browse/SPR-3882</a></p>
<p dir="auto">Enable usage of custom PropertyEditor for collection element for form:select bound to collection<br>
<a href="http://opensource.atlassian.com/projects/spring/browse/SPR-3654" rel="nofollow">http://opensource.atlassian.com/projects/spring/browse/SPR-3654</a></p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5 final</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="398079184" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8335" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8335/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8335">#8335</a> Enable usage of custom PropertyEditor for collection element for form:select bound to collection (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398085083" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9079" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9079/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9079">#9079</a> AbstractCheckedElementTag should properly pre-check items from a map or collection item source</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=haroon.rafique" rel="nofollow">Haroon Rafique</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4324?redirect=false" rel="nofollow">SPR-4324</a></strong> and commented</p>
<p dir="auto">The version bump from 2.5 to 2.5.1 breaks component scanning for me. Symptoms are that lots of beans annotated with <code class="notranslate">@Component</code> are being skipped for inclusion as beans. After digging through the code, I think the following commit is the culprit:</p>
<p dir="auto"><a href="http://fisheye1.cenqua.com/changelog/springframework?cs=MAIN:jhoeller:20080107164524" rel="nofollow">http://fisheye1.cenqua.com/changelog/springframework?cs=MAIN:jhoeller:20080107164524</a></p>
<p dir="auto">The commit message says:</p>
<p dir="auto">added "getEnclosingClassName()", "hasEnclosingClass()" and "isIndependent()" methods to ClassMetadata interface; ClassPathScanningCandidateComponentProvider ("context:component-scan") ignores non-static inner and local classes</p>
<p dir="auto">I am not sure why beanDefinition.getMetadata().isIndependent() is returning false for my classes. The scenario is as follows:</p>
<p dir="auto">MyBroker has <code class="notranslate">@Component</code> annotation. MyBroker uses a class MyService (regular instantiation) using something like:<br>
MyService service = new MyService()<br>
MyService, in turn, is the class which DOES have a local inner class. I think the bug is in identifying MyBroker as having an inner class. It should not identify MyBroker as having an inner class (since it doesn't have one).</p>
<p dir="auto">ClassMetaDataReadingVisitor.java has the following method:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public boolean isIndependent() {
	return (this.enclosingClassName == null || this.independentInnerClass);
}"><pre class="notranslate"><code class="notranslate">public boolean isIndependent() {
	return (this.enclosingClassName == null || this.independentInnerClass);
}
</code></pre></div>
<p dir="auto">In that method, while trying to see if MyBroker is a candidate, enclosingClassName is set to MyService.</p>
<p dir="auto">I think this needs a quick fix.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/13270/spring-2.5.1-component-scanning-inner-class-bug-SPR-4324.zip" rel="nofollow">spring-2.5.1-component-scanning-inner-class-bug-SPR-4324.zip</a> (<em>4.92 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="398085546" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9134" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9134/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9134">#9134</a> Weird autowiring bug (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398084711" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9029" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9029/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9029">#9029</a> context:annotation-config skips classes using inner classes in 2.5.1 (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398086023" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9204" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9204/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9204">#9204</a> bug in context:component-scan when class have inner classes  (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398084640" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9017" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9017/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9017">#9017</a> Classes with Inner classes are not recognized as independent classes themselves (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398087253" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9363" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9363/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9363">#9363</a> <code class="notranslate">@Component</code> annotated class that contains a private non-static inner class not considered as candidate component because  beanDefinition.getMetadata().isIndependent() returns false (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398085562" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9136" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9136/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9136">#9136</a> Component-scan does not work correctly for annotated service SimpleJdbcClinic in sample 'petclinic'</li>
</ul>