diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2012-01-25 01:40:57 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2012-01-25 01:40:57 +0000 |
commit | e640c47ae16d9d375010a18facd8a5bf4bd5c83e (patch) | |
tree | 8d26c507999f7a16330f8cf8d7a5be1a50f2f19a /src | |
parent | aea108ba2b5f22cf5615bd02d719786e84d359da (diff) |
Relax strict property match check.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/amazon/carbonado/info/StorableIntrospector.java | 9 |
1 files changed, 1 insertions, 8 deletions
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() +
|