[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5334) PersistenceUtilHelpe.findMember(Class, String) private method doesn't work with members of a superclass

Hardy Ferentschik (JIRA) noreply at atlassian.com
Thu Jul 8 05:50:14 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hardy Ferentschik resolved HHH-5334.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.6
                   3.5.x

Fixed bug in MetaDataCache.findMember on trunk and branch 3.5

> 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
>             Fix For: 3.5.x, 3.6
>
>
> 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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list