|
Off the top of my head, as someone not really knowing the sources, I see trouble in ReflectionHelper.getPropertyName(). If the method does not start with a valid prefix, null is returned and never checked.
public static String getPropertyName(Member member) {
String name = null;
if ( member instanceof Field ) {
name = member.getName();
}
if ( member instanceof Method ) {
String methodName = member.getName();
for ( String prefix : PROPERTY_ACCESSOR_PREFIXES ) {
if ( methodName.startsWith( prefix ) ) {
name = StringHelper.decapitalize( methodName.substring( prefix.length() ) );
}
}
}
return name;
}
This goes without checks into BeanMetaDataImpl.getMetaDataFor().
@Override
public PropertyMetaData getMetaDataFor(String propertyName) {
return propertyMetaDataMap.get( propertyName );
}
Again null is returned, and finally crashes in ValueContext.appendNode().
public final void appendNode(Cascadable node) {
propertyPath = PathImpl.createCopy( propertyPath );
if ( node.getKind() == ElementKind.PROPERTY ) {
propertyPath.addPropertyNode( node.getName() );
}
else if ( node.getKind() == ElementKind.PARAMETER ) {
propertyPath.addParameterNode( node.getName(), ( (ParameterMetaData) node ).getIndex() );
}
else if ( node.getKind() == ElementKind.RETURN_VALUE ) {
propertyPath.addReturnValueNode();
}
}
I do not have an environment set up at home, but I will test this as soon as I get back to work on Monday.
|