diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-05-24 21:15:41 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-05-24 21:15:41 +0000 |
commit | 98660bef8667d75a798b67f073703cd9ec051e9c (patch) | |
tree | f84245bc840f36a3bbd0ef102545093cb268153f /src/main/java/com/amazon/carbonado/gen | |
parent | 2c653b99372686e9b63b41c88ef40ffd2fba9df5 (diff) |
Fix bug which would throw spurious IllegalArgumentException from StorableGenerator.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/gen')
-rw-r--r-- | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java index 0fa8708..5f473cb 100644 --- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java +++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java @@ -1885,7 +1885,7 @@ public final class StorableGenerator<S extends Storable> { addAltKeyMethods:
for (int i=0; i<mInfo.getAlternateKeyCount(); i++) {
Map<String, StorableProperty<S>> altProps =
- new HashMap<String, StorableProperty<S>>();
+ new LinkedHashMap<String, StorableProperty<S>>();
StorableKey<S> altKey = mInfo.getAlternateKey(i);
@@ -1905,7 +1905,7 @@ public final class StorableGenerator<S extends Storable> { // Define protected isRequiredDataInitialized method.
defineIsRequiredDataInitialized: {
Map<String, StorableProperty<S>> requiredProperties =
- new HashMap<String, StorableProperty<S>>();
+ new LinkedHashMap<String, StorableProperty<S>>();
for (StorableProperty property : mAllProperties.values()) {
if (!property.isDerived() &&
@@ -2686,7 +2686,7 @@ public final class StorableGenerator<S extends Storable> { b.returnValue(TypeDesc.BOOLEAN);
}
- private int findPropertyOrdinal(StorableProperty property) {
+ private int findPropertyOrdinal(StorableProperty<S> property) {
int ordinal = 0;
for (StorableProperty<S> p : mAllProperties.values()) {
if (p == property) {
@@ -2694,7 +2694,8 @@ public final class StorableGenerator<S extends Storable> { }
ordinal++;
}
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException
+ ("Unable to find property " + property + " in " + mAllProperties);
}
/**
|