Author: hardy.ferentschik
Date: 2010-07-08 05:49:37 -0400 (Thu, 08 Jul 2010)
New Revision: 19917
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java
Log:
HHH-5334 Fixed bug in MetaDataCache.findMember
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java
===================================================================
---
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java 2010-07-08
09:47:26 UTC (rev 19916)
+++
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/util/PersistenceUtilHelper.java 2010-07-08
09:49:37 UTC (rev 19917)
@@ -192,7 +192,7 @@
return field;
}
catch ( NoSuchFieldException e ) {
- final Method method = getMethod( clazz, property );
+ final Method method = getMethod( current, property );
if (method != null) {
setAccessibility( method );
return method;
Modified:
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java
===================================================================
---
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java 2010-07-08
09:47:26 UTC (rev 19916)
+++
core/trunk/entitymanager/src/test/java/org/hibernate/ejb/test/util/PersistenceUtilHelperTest.java 2010-07-08
09:49:37 UTC (rev 19917)
@@ -28,28 +28,26 @@
import org.hibernate.ejb.util.PersistenceUtilHelper;
/**
- * Tests for HHH-5094
+ * Tests for HHH-5094 and HHH-5334
*
* @author Hardy Ferentschik
*/
public class PersistenceUtilHelperTest extends junit.framework.TestCase {
private final PersistenceUtilHelper.MetadataCache cache = new
PersistenceUtilHelper.MetadataCache();
- public static class FieldAccessBean {
- public String publicAccessProperty;
+ public static class FieldAccessBean extends FieldAccessBeanBase {
protected String protectedAccessProperty;
private String privateAccessProperty;
}
- public static class MethodAccessBean {
- private String publicAccessProperty;
+ public static class FieldAccessBeanBase {
+ public String publicAccessProperty;
+ }
+
+ public static class MethodAccessBean extends MethodAccessBeanBase {
private String protectedAccessProperty;
private String privateAccessProperty;
- public String getPublicAccessPropertyValue() {
- return publicAccessProperty;
- }
-
protected String getProtectedAccessPropertyValue() {
return protectedAccessProperty;
}
@@ -59,6 +57,14 @@
}
}
+ public static class MethodAccessBeanBase {
+ private String publicAccessProperty;
+
+ public String getPublicAccessPropertyValue() {
+ return publicAccessProperty;
+ }
+ }
+
public void testIsLoadedWithReferencePublicField() {
assertEquals(
LoadState.UNKNOWN,