From e640c47ae16d9d375010a18facd8a5bf4bd5c83e Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Wed, 25 Jan 2012 01:40:57 +0000 Subject: Relax strict property match check. --- .../java/com/amazon/carbonado/info/StorableIntrospector.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java index 1ec0575..66276e1 100644 --- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java @@ -1010,13 +1010,6 @@ public class StorableIntrospector { ("Must define proper 'get' method for property: " + property.getName()); } } else { - if (readMethod.getReturnType() != property.getType()) { - errorMessages.add - ("Property type doesn't match accessor method return type: " + - property.getType().getName() + " != " + readMethod.getReturnType().getName() + - " for " + readMethod); - } - nullable = readMethod.getAnnotation(Nullable.class); alias = readMethod.getAnnotation(Alias.class); version = readMethod.getAnnotation(Version.class); @@ -1072,7 +1065,7 @@ public class StorableIntrospector { Class[] writeParams = writeMethod.getParameterTypes(); if (writeParams == null || writeParams.length != 1) { errorMessages.add("Mutator method must contain one parameter: " + writeMethod); - } else if (writeParams[0] != property.getType()) { + } else if (!writeParams[0].isAssignableFrom(property.getType())) { errorMessages.add ("Property type doesn't match mutator method parameter: " + property.getType().getName() + " != " + writeParams[0].getName() + -- cgit v1.2.3