summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2006-09-20 03:00:40 +0000
committerBrian S. O'Neill <bronee@gmail.com>2006-09-20 03:00:40 +0000
commitc16716f2d8e15f6539995c656ad05e4e8f799a21 (patch)
tree55a1bac1f15d23fbea3b665a56f1d94ccc5842ef /src/main/java/com/amazon/carbonado
parent1c9a5991aa49724c34a20fcea6fd1252ce03b8d9 (diff)
More tests and fixes.
Diffstat (limited to 'src/main/java/com/amazon/carbonado')
-rw-r--r--src/main/java/com/amazon/carbonado/info/StorableIntrospector.java4
-rw-r--r--src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java10
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
index ac3cd24..ab60720 100644
--- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
+++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
@@ -1528,8 +1528,8 @@ public class StorableIntrospector {
}
public int hashCode() {
- return (getName().hashCode() * 31 + getType().hashCode()) * 31
- + getEnclosingType().hashCode();
+ return (getName().hashCode() * 31 + getType().getName().hashCode()) * 31
+ + getEnclosingType().getName().hashCode();
}
public boolean equals(Object obj) {
diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
index c64e4d4..b06edba 100644
--- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
@@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -179,7 +179,9 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact
Map<ChainedProperty<S>, Tally> superKey = new LinkedHashMap<ChainedProperty<S>, Tally>();
for (Set<ChainedProperty<S>> key : keys) {
for (ChainedProperty<S> property : key) {
- superKey.put(property, new Tally(property));
+ if (!superKey.containsKey(property)) {
+ superKey.put(property, new Tally(property));
+ }
}
}
@@ -274,7 +276,7 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact
}
int propCount = index.getPropertyCount();
- Set<ChainedProperty<S>> props = new HashSet<ChainedProperty<S>>(propCount);
+ Set<ChainedProperty<S>> props = new LinkedHashSet<ChainedProperty<S>>(propCount);
for (int i=0; i<propCount; i++) {
props.add(index.getOrderedProperty(i).getChainedProperty());
@@ -287,7 +289,7 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact
}
private Set<ChainedProperty<S>> stripOrdering(Set<? extends OrderedProperty<S>> orderedProps) {
- Set<ChainedProperty<S>> props = new HashSet<ChainedProperty<S>>(orderedProps.size());
+ Set<ChainedProperty<S>> props = new LinkedHashSet<ChainedProperty<S>>(orderedProps.size());
for (OrderedProperty<S> ordering : orderedProps) {
props.add(ordering.getChainedProperty());
}