Closed
Description
Greg Nieman opened SPR-8522 and commented
Creation of a GsonBuilder using @Bean fails with java.beans.IntrospectionException: type mismatch between indexed and non-indexed methods: dateFormat. Rolling back to 3.0.5 the same code works. The exception occurs in the addOrUpdatePropertyDescriptor method of the ExtendedBeanInfo class at line 230 when it attempts to set the indexedReadMethod, which IIRC is a null value.
Attached is a small sample that illustrates this. The pom is set so you can toggle back and forth between 3.1 and 3.0.5 to see the behavior.
Affects: 3.1 M2
Attachments:
- testconfig.zip (24.75 kB)
Issue Links:
- Overhaul non-void JavaBean write method support [SPR-10029] #14663 Overhaul non-void JavaBean write method support
1 votes, 2 watchers
Activity
spring-projects-issues commentedon Jul 16, 2011
Chris Beams commented
Hi Greg,
Thanks for the submission! In the future, please leave the fixVersion blank when submitting issues. You may also wish to submit reproduction issues following the instructions here https://github.com/SpringSource/spring-framework-issues#readme. Either way is fine, but if you prefer pull requests via git, it's that much easier for us.
spring-projects-issues commentedon Aug 28, 2011
Chris Beams commented
Greg,
Thanks again for reporting this; it ended up being a rather simple fix in ExtendedBeanInfo, and you can test it out against the next 3.1.0.BUILD-SNAPSHOT.
You may also be interested to know that I checked in your attachement as a reproduction project at https://github.com/SpringSource/spring-framework-issues/tree/master/SPR-8522
spring-projects-issues commentedon Jan 8, 2012
Stevo Slavić commented
ExtendedBeanInfoTests.reproSpr8522 and some other tests fail when run with Java 7 (openjdk & oracle).
Test passes when run using Java 6 (openjdk). Looking at the source of Introspector, in getTargetPropertyInfo at least following has been changed:
from
to
It seems that non-standard indexed write methods like
are no longer supported - method has to return void.
After changing these setters to return void, tests would pass on both Java 6 and Java 7.
spring-projects-issues commentedon Jan 9, 2012
Chris Beams commented
Stevo - could you open a new issue for this? It'll get lost otherwise.
Thanks
spring-projects-issues commentedon Jan 9, 2012
Stevo Slavić commented
Created #13646
spring-projects-issues commentedon Nov 25, 2012
Chris Beams commented
A general note to watchers of
ExtendedBeanInfo-related issues: #14663 is a major refactoring ofExtendedBeanInfoand overall support for non-void returning setter methods.If you have submitted a reproduction project with this issue, we have run it through its paces against these new changes, but we would like to ask you to do the same against your actual applications.
Please consider updating your dev or test builds to work against 3.1.4.BUILD-SNAPSHOT and/or 3.2.0.BUILD-SNAPSHOT to verify, and we would appreciate any feedback, even if it's to let us know that all is well. So that we can consolidate feedback, please add your comments to #14663, and mention the original issue(s) that you were watching.
Thanks!
Note also that testing against 3.1.4 is preferable to 3.2.0 because
ExtendedBeanInfois always in the code path in the latter, while in 3.2.0 we've optimized things such thatExtendedBeanInfois only in play for bean classes that have one or more non-void returning setter methods.