Closed
Description
Piotr Findeisen opened SPR-10995 and commented
Steps to Reproduce
- Create a class with a property (getter/setter) of type
Bar
. - Create a subclass that overrides the getter narrowing the return type to
MoreBar extends Bar
. - Try to set the property in XML config.
Expectation
It worked in 3.1.2, so it should work now.
Failing Exception
org.springframework.beans.factory.BeanCreationException: Error creating bean ...
...
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'bar' of bean class [...]: Bean property 'bar' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Affects: 3.1.4
0 votes, 5 watchers