From c16716f2d8e15f6539995c656ad05e4e8f799a21 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Wed, 20 Sep 2006 03:00:40 +0000 Subject: More tests and fixes. --- .../java/com/amazon/carbonado/info/StorableIntrospector.java | 4 ++-- src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java | 10 ++++++---- 2 files changed, 8 insertions(+), 6 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 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 implements QueryExecutorFact Map, Tally> superKey = new LinkedHashMap, Tally>(); for (Set> key : keys) { for (ChainedProperty 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 implements QueryExecutorFact } int propCount = index.getPropertyCount(); - Set> props = new HashSet>(propCount); + Set> props = new LinkedHashSet>(propCount); for (int i=0; i implements QueryExecutorFact } private Set> stripOrdering(Set> orderedProps) { - Set> props = new HashSet>(orderedProps.size()); + Set> props = new LinkedHashSet>(orderedProps.size()); for (OrderedProperty ordering : orderedProps) { props.add(ordering.getChainedProperty()); } -- cgit v1.2.3