You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression - Introspection with BeanUtils started failing for java.awt.Component derived classes [SPR-8491] #13137
public void setSize(int width, int height)
and
public void setSize(Dimension d)
introspection of classes derived from this base class (using BeanUtils.getPropertyDescriptor) now crashes with following exception
...
Caused by: java.beans.IntrospectionException: type mismatch between indexed and non-indexed methods: size
at java.beans.IndexedPropertyDescriptor.findIndexedPropertyType(IndexedPropertyDescriptor.java:341)
at java.beans.IndexedPropertyDescriptor.setIndexedWriteMethod(IndexedPropertyDescriptor.java:248)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:233)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:178)
at org.springframework.beans.ExtendedBeanInfo.<init>(ExtendedBeanInfo.java:108)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
... 92 more
I guess that this can be omitted by first checking whether or not index method really has to be updated or not (it seems to be already null)
This turned out to be quite fatal for me since beanWrapper.getPropertyDescriptors suffers from the same problem thus preventing creation of all Swing based beans.
java.beans.IntrospectionException: type mismatch between indexed and non-indexed methods: size
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:262)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:149)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:304)
at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptors(BeanWrapperImpl.java:311)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.filterPropertyDescriptorsForDependencyCheck(AbstractAutowireCapableBeanFactory.java:1208)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1069)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 81 more
Caused by: java.beans.IntrospectionException: type mismatch between indexed and non-indexed methods: size
at java.beans.IndexedPropertyDescriptor.findIndexedPropertyType(IndexedPropertyDescriptor.java:341)
at java.beans.IndexedPropertyDescriptor.setIndexedWriteMethod(IndexedPropertyDescriptor.java:248)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:233)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:178)
at org.springframework.beans.ExtendedBeanInfo.<init>(ExtendedBeanInfo.java:108)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
... 87 more
Tried the git push approach but failing many times after trying several ways (with Windows machine) I gave up and used the good-old-way.
Reproduction of the issue was a bit tricky since introspection seems to either fail with size or location properties or not at all depending on the order of method/property descriptors it is given.
What the correct result of the introspection might be (other than not failing) is just a suggestion.
Thanks for the reproduction project. Try upgrading to 3.1.0.BUILD-SNAPSHOT and you'll see most of the issues are resolved thanks to some fixes that just got in for #13448.
The reproLocation... and reproSize... methods do still fail and that's probably a legitimate issue where ExtendedBeanInfo is getting confused about read methods in situations where there is a non-standard arrangement of write methods (which is exactly the case with the 'size' and 'location' properties. Keep in mind here that the standard JavaBeans Introspector class completely gives up on these properties -- it's only because of our aggressive approach to finding every possible property that we pick these up at all.
So, please take a look under the latest snapshot and confirm the fixes on your end. If the size and location issues remain important for you, please open a separate issue and mention this one when you do.
Cheers,
Chris
P.S. I've committed the reproduction project to spring-framework-issues, including updating to 3.1.0.BUILD-SNAPSHOT
A general note to watchers of ExtendedBeanInfo-related issues: #14663 is a major refactoring of ExtendedBeanInfo and 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 ExtendedBeanInfo is always in the code path in the latter, while in 3.2.0 we've optimized things such that ExtendedBeanInfo is only in play for bean classes that have one or more non-void returning setter methods.
Activity
spring-projects-issues commentedon Jun 27, 2011
Tuomas Kiviaho commented
This turned out to be quite fatal for me since beanWrapper.getPropertyDescriptors suffers from the same problem thus preventing creation of all Swing based beans.
java.beans.IntrospectionException: type mismatch between indexed and non-indexed methods: size
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:262)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:149)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:304)
at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptors(BeanWrapperImpl.java:311)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.filterPropertyDescriptorsForDependencyCheck(AbstractAutowireCapableBeanFactory.java:1208)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1069)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 81 more
Caused by: java.beans.IntrospectionException: type mismatch between indexed and non-indexed methods: size
at java.beans.IndexedPropertyDescriptor.findIndexedPropertyType(IndexedPropertyDescriptor.java:341)
at java.beans.IndexedPropertyDescriptor.setIndexedWriteMethod(IndexedPropertyDescriptor.java:248)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:233)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:178)
at org.springframework.beans.ExtendedBeanInfo.<init>(ExtendedBeanInfo.java:108)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
... 87 more
spring-projects-issues commentedon Jun 29, 2011
Chris Beams commented
Hi Tuomas, thanks for the report. Would you be willing to submit a small project that reproduces this issue based on the instructions at https://github.com/SpringSource/spring-framework-issues#readme ?
It certainly sounds like an issue, and we'll look into it in any case, but this will help us to prioritize it and get to it quickly. Thanks!
spring-projects-issues commentedon Jul 3, 2011
Tuomas Kiviaho commented
Tried the git push approach but failing many times after trying several ways (with Windows machine) I gave up and used the good-old-way.
Reproduction of the issue was a bit tricky since introspection seems to either fail with size or location properties or not at all depending on the order of method/property descriptors it is given.
What the correct result of the introspection might be (other than not failing) is just a suggestion.
spring-projects-issues commentedon Oct 25, 2011
Haroldo de Oliveira Pinheiro commented
For a quick-and-dirty test:
org.springframework.beans.BeanUtils.getPropertyDescriptors(javax.swing.JButton.class);
Seems to fail every single time.
spring-projects-issues commentedon Nov 25, 2011
Chris Beams commented
Tuomas,
Thanks for the reproduction project. Try upgrading to 3.1.0.BUILD-SNAPSHOT and you'll see most of the issues are resolved thanks to some fixes that just got in for #13448.
The
reproLocation...andreproSize...methods do still fail and that's probably a legitimate issue whereExtendedBeanInfois getting confused about read methods in situations where there is a non-standard arrangement of write methods (which is exactly the case with the 'size' and 'location' properties. Keep in mind here that the standard JavaBeansIntrospectorclass completely gives up on these properties -- it's only because of our aggressive approach to finding every possible property that we pick these up at all.So, please take a look under the latest snapshot and confirm the fixes on your end. If the size and location issues remain important for you, please open a separate issue and mention this one when you do.
Cheers,
Chris
P.S. I've committed the reproduction project to
spring-framework-issues, including updating to 3.1.0.BUILD-SNAPSHOTspring-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.