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
Java 7 only - PropertyPathFactoryBean requires a bean setter in version 3.1.1.RELEASE. Works fine under Java 6. [SPR-9414] #14050
has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug
Exactly the same example specified in issue #13589 now works fine in Java 6 (after the bug fix) but does not work under Java 7, specifically tested under Oracle JDK 1.7.0_04.
Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.example.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:576)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:553)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:719)
at org.springframework.beans.factory.config.PropertyPathFactoryBean.getObject(PropertyPathFactoryBean.java:208)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 37 more
Thanks, David. Can you confirm whether ExtendedBeanInfoTests passes for you under JDK 7? If you haven't built the framework before, it's quite easy these days.
Just ran the ExtendedBeanInfoTests (on master 04bfc80) under JDK 7 (update 5) and it fails for the standardReadMethodsAndOverloadedNonStandardWriteMethods test method. Note all tests do pass for JDK 6 (update 33).
I found this issue while investigating a problem with PropertyAccessorFactory.forBeanPropertyAccess under Java 7. I wrote an additional test case for the ExtendedBeanInfoTests to demonstrate the issue (note this passes under Java 6):
@Test
public void exampleFailure() throws IntrospectionException {
@SuppressWarnings("unused") class Parent {
public Number getProperty1() {
return 1;
}
}
class Child extends Parent {
@Override
public Integer getProperty1() {
return 2;
}
}
{
ExtendedBeanInfo bi = new ExtendedBeanInfo(Introspector.getBeanInfo(Parent.class));
assertThat(hasReadMethodForProperty(bi, "property1"), is(true)); //passes
}
{
ExtendedBeanInfo bi = new ExtendedBeanInfo(Introspector.getBeanInfo(Child.class));
assertThat(hasReadMethodForProperty(bi, "property1"), is(true)); //fails???
}
}
I can open a new issue if necessary, but it appears there may be more than one issue with the ExtendedBeanInfo class under Java 7.
This issue is now resolved with the commit shown below.
More importantly, with the completion of #14357ExtendedBeanInfo is now no longer part of the default code path, meaning that even though this regression has been fixed, it would no longer be encountered anyway. Note that #14357 applies only to 3.2 and beyond, whereas the specific fix addressed by this issue will be backported to 3.1.x with #14412.
commit b50bb5071ac353e77e9d38c72f888de3add923b2
Author: Chris Beams <[email protected]>
Commit: Chris Beams <[email protected]>
Address various ExtendedBeanInfo bugs
- Ensure that ExtendedBeanInfoTests succeeds when building under JDK 7
- Improve handling of read and write method registration where
generic interfaces are involved, per SPR-9453
- Add repro test for SPR-9702, in which EBI fails to register
an indexed read method under certain circumstances
Issue: SPR-9702, SPR-9414, SPR-9453
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.
has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug
Activity
spring-projects-issues commentedon May 16, 2012
David Boden commented
Example stack trace:
Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'options' of bean class [com.example.CoreCommandLineArgumentProcessorImpl]: Bean property 'options' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:576)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:553)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:719)
at org.springframework.beans.factory.config.PropertyPathFactoryBean.getObject(PropertyPathFactoryBean.java:208)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 37 more
spring-projects-issues commentedon May 16, 2012
Chris Beams commented
Thanks, David. Can you confirm whether
ExtendedBeanInfoTestspasses for you under JDK 7? If you haven't built the framework before, it's quite easy these days.spring-projects-issues commentedon Aug 2, 2012
Daniel Mavis commented
Just ran the
ExtendedBeanInfoTests(on master 04bfc80) under JDK 7 (update 5) and it fails for thestandardReadMethodsAndOverloadedNonStandardWriteMethodstest method. Note all tests do pass for JDK 6 (update 33).spring-projects-issues commentedon Aug 3, 2012
Daniel Mavis commented
I found this issue while investigating a problem with
PropertyAccessorFactory.forBeanPropertyAccessunder Java 7. I wrote an additional test case for theExtendedBeanInfoTeststo demonstrate the issue (note this passes under Java 6):I can open a new issue if necessary, but it appears there may be more than one issue with the
ExtendedBeanInfoclass under Java 7.spring-projects-issues commentedon Aug 3, 2012
Chris Beams commented
@Daniel, no need for a new issue at this point. Thanks for the test.spring-projects-issues commentedon Sep 9, 2012
Chris Beams commented
This issue is now resolved with the commit shown below.
More importantly, with the completion of #14357
ExtendedBeanInfois now no longer part of the default code path, meaning that even though this regression has been fixed, it would no longer be encountered anyway. Note that #14357 applies only to 3.2 and beyond, whereas the specific fix addressed by this issue will be backported to 3.1.x with #14412.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.