]
Hardy Ferentschik reassigned HHH-5334:
--------------------------------------
Assignee: Hardy Ferentschik
PersistenceUtilHelpe.findMember(Class, String) private method
doesn't work with members of a superclass
-------------------------------------------------------------------------------------------------------
Key: HHH-5334
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5334
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.3
Reporter: Valentino Proietti
Assignee: Hardy Ferentschik
It is clear to me that the line:
final Method method = getMethod( clazz, property );
should be replaced with:
final Method method = getMethod( current, property );
Thanks
private Member findMember(Class<?> clazz, String property) {
final List<Class<?>> classes = getClassHierarchy( clazz );
for (Class current : classes) {
final Field field;
try {
field = current.getDeclaredField( property );
setAccessibility( field );
return field;
}
catch ( NoSuchFieldException e ) {
final Method method = getMethod( clazz, property );
if (method != null) {
setAccessibility( method );
return method;
}
}
}
//we could not find any match
throw new PersistenceException( "Unable to find field or method: "
+ clazz + "#"
+ property);
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: