diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-08-14 17:09:20 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-08-14 17:09:20 +0000 |
commit | b956b6fde3a1a3e485956f1075412fa8a52e8fe9 (patch) | |
tree | d9dccf9d2dff11e382090552528f3caddf7f198e /src/main/java/com/amazon/carbonado/info | |
parent | a4aa08342e5afe143df42a641a23efd24a0cafb0 (diff) |
Removed support for Storable definition to accept Repository in constructor.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/info')
-rw-r--r-- | src/main/java/com/amazon/carbonado/info/StorableIntrospector.java | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java index 133e175..b7f7744 100644 --- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java @@ -62,7 +62,6 @@ import com.amazon.carbonado.Nullable; import com.amazon.carbonado.Independent;
import com.amazon.carbonado.PrimaryKey;
import com.amazon.carbonado.Query;
-import com.amazon.carbonado.Repository;
import com.amazon.carbonado.Sequence;
import com.amazon.carbonado.Storable;
import com.amazon.carbonado.Version;
@@ -491,35 +490,29 @@ public class StorableIntrospector { checkTypeParameter(errorMessages, type);
- // If type is a class, it must have a public/protected constructor that
- // takes no arguments or a Repository. If overloaded, the constructor
- // with the Repository parameter is preferred by the code generator.
+ // If type is a class, it must have a public or protected no-arg
+ // constructor.
if (!type.isInterface()) {
Constructor[] ctors = type.getDeclaredConstructors();
findCtor: {
for (Constructor c : ctors) {
- modifiers = c.getModifiers();
- if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
- continue;
- }
if (c.getParameterTypes().length == 0) {
- break findCtor;
- }
- if (c.getParameterTypes().length == 1) {
- if (c.getParameterTypes()[0] == Repository.class) {
- break findCtor;
+ modifiers = c.getModifiers();
+ if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) {
+ errorMessages.add("Cannot call constructor: " + c);
}
+ break findCtor;
}
}
if (type.getEnclosingClass() == null) {
errorMessages.add
("Class must have a public or protected constructor " +
- "that takes no arguments or a Repository");
+ "that accepts no arguments");
} else {
errorMessages.add
("Inner class must have a public or protected constructor " +
- "that takes no arguments or a Repository");
+ "that accepts no arguments");
}
}
}
|