From ab92f4ec859413b2d3612068dfb21d741fb389a3 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 6 May 2008 13:52:12 +0000 Subject: Code cleanup: add @Override annotations, remove unused imports, remove dead code and add @Deprecated annotations. --- src/main/java/com/amazon/carbonado/qe/CompositeScore.java | 1 + src/main/java/com/amazon/carbonado/qe/EmptyQuery.java | 1 + src/main/java/com/amazon/carbonado/qe/FilteringScore.java | 4 ++++ src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java | 1 + src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java | 1 + src/main/java/com/amazon/carbonado/qe/OrderingList.java | 6 +++++- src/main/java/com/amazon/carbonado/qe/OrderingScore.java | 1 + src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java | 7 +++++++ src/main/java/com/amazon/carbonado/qe/QueryEngine.java | 5 +++++ src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java | 2 ++ src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java | 1 + 11 files changed, 29 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/amazon/carbonado/qe') diff --git a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java index 51c1f73..fd7d9c8 100644 --- a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java +++ b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java @@ -218,6 +218,7 @@ public class CompositeScore { mOrderingScore.withRemainderOrdering(ordering)); } + @Override public String toString() { return "CompositeScore {" + getFilteringScore() + ", " + getOrderingScore() + '}'; } diff --git a/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java b/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java index 0ddc561..e9431f3 100644 --- a/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java +++ b/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java @@ -227,6 +227,7 @@ public final class EmptyQuery extends AbstractQuery { /** * Always throws {@link PersistNoneException}. */ + @Override public void deleteOne() throws PersistNoneException { throw new PersistNoneException(); } diff --git a/src/main/java/com/amazon/carbonado/qe/FilteringScore.java b/src/main/java/com/amazon/carbonado/qe/FilteringScore.java index 5efb219..6fa6ca0 100644 --- a/src/main/java/com/amazon/carbonado/qe/FilteringScore.java +++ b/src/main/java/com/amazon/carbonado/qe/FilteringScore.java @@ -699,6 +699,7 @@ public class FilteringScore { return new FilteringScore(this, filter); } + @Override public String toString() { return "FilteringScore {identityCount=" + getIdentityCount() + ", hasRangeStart=" + hasRangeStart() + @@ -767,16 +768,19 @@ public class FilteringScore { private boolean isProvidedByIndex(Filter filter) { return filter.accept(new Visitor() { + @Override public Boolean visit(OrFilter filter, Object param) { return filter.getLeftFilter().accept(this, param) && filter.getRightFilter().accept(this, param); } + @Override public Boolean visit(AndFilter filter, Object param) { return filter.getLeftFilter().accept(this, param) && filter.getRightFilter().accept(this, param); } + @Override public Boolean visit(PropertyFilter filter, Object param) { ChainedProperty filterProp = filter.getChainedProperty(); for (OrderedProperty indexProp : mIndexProperties) { diff --git a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java index 3ddd828..875eda3 100644 --- a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java +++ b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java @@ -544,6 +544,7 @@ public class IndexedQueryAnalyzer { return executor; } + @Override public String toString() { return "IndexedQueryAnalyzer.Result {score=" + getCompositeScore() + ", localIndex=" diff --git a/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java b/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java index f26a9b3..e6f4248 100644 --- a/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java +++ b/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java @@ -61,6 +61,7 @@ public class KeyQueryExecutor extends AbstractQueryExecutor< mKeyFilter = score.getIdentityFilter(); } + @Override public Class getStorableType() { // Storable type of filter may differ if index is used along with a // join. The type of the index is the correct storable type. diff --git a/src/main/java/com/amazon/carbonado/qe/OrderingList.java b/src/main/java/com/amazon/carbonado/qe/OrderingList.java index b6235ac..b096aae 100644 --- a/src/main/java/com/amazon/carbonado/qe/OrderingList.java +++ b/src/main/java/com/amazon/carbonado/qe/OrderingList.java @@ -49,6 +49,8 @@ import com.amazon.carbonado.info.StorableIntrospector; public class OrderingList extends AbstractList> implements Serializable { + private static final long serialVersionUID = 3692335128299485356L; + private static final OrderingList EMPTY_LIST = new OrderingList(); private static final Map cCache; @@ -154,10 +156,12 @@ public class OrderingList extends AbstractList get(int index) { return asArray()[index]; } @@ -363,7 +367,7 @@ public class OrderingList extends AbstractList[] mOrderings; + private OrderedProperty[] mOrderings; // Required for Externalizable. public Orderings() { diff --git a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java index abf7ac8..9bfcde1 100644 --- a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java +++ b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java @@ -483,6 +483,7 @@ public class OrderingScore { return new OrderingScore(this, ordering); } + @Override public String toString() { return "OrderingScore {handledCount=" + getHandledCount() + ", remainderCount=" + getRemainderCount() + diff --git a/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java b/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java index c58aacb..378fc68 100644 --- a/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java +++ b/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java @@ -86,15 +86,18 @@ class PropertyFilterList extends AbstractList> fexistsList = existsList; filter.accept(new Visitor() { + @Override public Object visit(OrFilter filter, Object param) { throw new IllegalArgumentException("OrFilter not allowed"); } + @Override public Object visit(ExistsFilter filter, Object param) { fexistsList.add(filter); return null; } + @Override public Object visit(PropertyFilter filter, Object param) { flist.add(filter); return null; @@ -139,10 +142,12 @@ class PropertyFilterList extends AbstractList get(int index) { return mList.get(index); } @@ -157,6 +162,8 @@ class PropertyFilterList extends AbstractList implements Comparator>, java.io.Serializable { + private static final long serialVersionUID = 2322537712763223517L; + public int compare(PropertyFilter a, PropertyFilter b) { if (a.getOperator() != b.getOperator()) { if (a.getOperator() == RelOp.EQ) { diff --git a/src/main/java/com/amazon/carbonado/qe/QueryEngine.java b/src/main/java/com/amazon/carbonado/qe/QueryEngine.java index 8e9d642..9b2c13f 100644 --- a/src/main/java/com/amazon/carbonado/qe/QueryEngine.java +++ b/src/main/java/com/amazon/carbonado/qe/QueryEngine.java @@ -49,6 +49,7 @@ public class QueryEngine extends StandardQueryFactory return mExecutorFactory.executor(filter, ordering, hints); } + @Override protected StandardQuery createQuery(Filter filter, FilterValues values, OrderingList ordering, @@ -66,18 +67,22 @@ public class QueryEngine extends StandardQueryFactory super(filter, values, ordering, hints); } + @Override protected Transaction enterTransaction(IsolationLevel level) { return mRepoAccess.getRootRepository().enterTransaction(level); } + @Override protected QueryFactory queryFactory() { return QueryEngine.this; } + @Override protected QueryExecutorFactory executorFactory() { return mExecutorFactory; } + @Override protected StandardQuery newInstance(FilterValues values, OrderingList ordering, QueryHints hints) diff --git a/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java b/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java index 7055b21..bfa63b1 100644 --- a/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java +++ b/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java @@ -475,6 +475,8 @@ public class StorableIndexSet extends TreeSet>, java.io.Serializable { + private static final long serialVersionUID = 2204885249683067349L; + public int compare(StorableIndex a, StorableIndex b) { if (a == b) { return 0; diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java index 67da7ee..6e5262f 100644 --- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java +++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java @@ -558,6 +558,7 @@ public class UnionQueryAnalyzer implements QueryExecutorFact return 0; } + @Override public String toString() { return "Tally: {property=" + mProperty + ", asc=" + mAscendingCount + -- cgit v1.2.3