Author: steve.ebersole(a)jboss.com
Date: 2008-03-17 18:17:35 -0400 (Mon, 17 Mar 2008)
New Revision: 14448
Modified:
core/trunk/core/src/main/java/org/hibernate/property/BasicPropertyAccessor.java
Log:
HHH-2268 : handle bridged return types for getters
Modified: core/trunk/core/src/main/java/org/hibernate/property/BasicPropertyAccessor.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/property/BasicPropertyAccessor.java 2008-03-17
20:57:09 UTC (rev 14447)
+++
core/trunk/core/src/main/java/org/hibernate/property/BasicPropertyAccessor.java 2008-03-17
22:17:35 UTC (rev 14448)
@@ -316,8 +316,8 @@
Method[] methods = theClass.getDeclaredMethods();
for (int i=0; i<methods.length; i++) {
- // only carry on if the method has no parameters
- if ( methods[i].getParameterTypes().length==0 ) {
+ // only carry on if the method has no parameters and is not a bridge
+ if ( methods[i].getParameterTypes().length == 0 && !methods[i].isBridge() ) {
String methodName = methods[i].getName();
// try "get"
@@ -330,9 +330,7 @@
}
- // if not "get" then try "is"
- /*boolean isBoolean = methods[i].getReturnType().equals(Boolean.class) ||
- methods[i].getReturnType().equals(boolean.class);*/
+ // if not "get", then try "is"
if ( methodName.startsWith("is") ) {
String testStdMethod = Introspector.decapitalize( methodName.substring(2) );
String testOldMethod = methodName.substring(2);