Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Nightly Builds
-
None
-
None
Description
Problem: The following statement in line 50 in DefaultBeanAccessor may cause a NullPointerException, because getReadMethod() will return null, if no getter for the property is present:
Object newBean = propertyDescriptor.getReadMethod().invoke( bean );
Solution: throw a NoSuchMethodException, if the property is write only.
if ( propertyDescriptor.getReadMethod() == null ) { throw new NoSuchMethodException( String.format( "Bean of type %s does not provide a getter for property '%s'!", bean.getClass().getName(), name ) ); }