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/cursor/FilteredCursor.java | 1 + .../java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java | 6 +++++- src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java | 1 + src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java | 8 ++++++++ .../java/com/amazon/carbonado/cursor/MultiTransformedCursor.java | 1 + src/main/java/com/amazon/carbonado/cursor/SortedCursor.java | 1 + src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java | 1 + src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java | 1 + src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java | 1 + 9 files changed, 20 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/amazon/carbonado/cursor') diff --git a/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java b/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java index 59cb941..93b7bc0 100644 --- a/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java +++ b/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java @@ -153,6 +153,7 @@ public abstract class FilteredCursor extends AbstractCursor { throw new NoSuchElementException(); } + @Override public int skipNext(int amount) throws FetchException { if (amount <= 0) { if (amount < 0) { diff --git a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java index 4e58361..c7dec07 100644 --- a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java +++ b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java @@ -18,7 +18,6 @@ package com.amazon.carbonado.cursor; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; @@ -217,6 +216,7 @@ class FilteredCursorGenerator { Validator() { } + @Override public Object visit(PropertyFilter filter, Object param) { ChainedProperty chained = filter.getChainedProperty(); @@ -304,6 +304,7 @@ class FilteredCursorGenerator { return mSubFilters; } + @Override public Object visit(OrFilter filter, Object param) { Label failLocation = mIsAllowedBuilder.createLabel(); // Inherit success location to short-circuit if 'or' test succeeds. @@ -315,6 +316,7 @@ class FilteredCursorGenerator { return null; } + @Override public Object visit(AndFilter filter, Object param) { Label successLocation = mIsAllowedBuilder.createLabel(); // Inherit fail location to short-circuit if 'and' test fails. @@ -326,6 +328,7 @@ class FilteredCursorGenerator { return null; } + @Override public Object visit(PropertyFilter filter, Object param) { TypeDesc type = TypeDesc.forClass(filter.getChainedProperty().getType()); String fieldName = addFilterField(filter, type); @@ -334,6 +337,7 @@ class FilteredCursorGenerator { return null; } + @Override public Object visit(ExistsFilter filter, Object param) { // Load join property value to stack. CodeBuilder b = mIsAllowedBuilder; diff --git a/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java b/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java index 6d9afc5..135d817 100644 --- a/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java +++ b/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java @@ -194,6 +194,7 @@ public abstract class GroupedCursor extends AbstractCursor { throw new NoSuchElementException(); } + @Override public int skipNext(int amount) throws FetchException { if (amount <= 0) { if (amount < 0) { diff --git a/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java b/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java index b02f9bf..31359e8 100644 --- a/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java +++ b/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java @@ -189,6 +189,7 @@ public class MergeSortBuffer extends AbstractCollection mComparator = comparator; } + @Override public boolean add(S storable) { if (mPreparer == null) { mPreparer = new FromStorable(storable); @@ -307,10 +308,12 @@ public class MergeSortBuffer extends AbstractCollection return true; } + @Override public int size() { return mTotalSize; } + @Override public Iterator iterator() { return iterator(mFilesInUse); } @@ -342,6 +345,7 @@ public class MergeSortBuffer extends AbstractCollection return new Merger(pq); } + @Override public void clear() { if (mPreparer instanceof FromStorable) { mPreparer = null; @@ -474,6 +478,7 @@ public class MergeSortBuffer extends AbstractCollection mSize = size; } + @Override S peek() { int pos = mPos; if (pos >= mSize) { @@ -482,6 +487,7 @@ public class MergeSortBuffer extends AbstractCollection return mArray[pos]; } + @Override S next() { int pos = mPos; if (pos >= mSize) { @@ -508,6 +514,7 @@ public class MergeSortBuffer extends AbstractCollection mIn = in; } + @Override S peek() { if (mNext != null) { return mNext; @@ -528,6 +535,7 @@ public class MergeSortBuffer extends AbstractCollection return mNext; } + @Override S next() { S next = peek(); mNext = null; diff --git a/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java b/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java index 4b4a25a..fafb55f 100644 --- a/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java +++ b/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java @@ -114,6 +114,7 @@ public abstract class MultiTransformedCursor extends AbstractCursor { throw new NoSuchElementException(); } + @Override public int skipNext(int amount) throws FetchException { if (amount <= 0) { if (amount < 0) { diff --git a/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java b/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java index 2a05493..e4e7b68 100644 --- a/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java +++ b/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java @@ -341,6 +341,7 @@ public class SortedCursor extends AbstractCursor { } } + @Override public int skipNext(int amount) throws FetchException { if (amount <= 0) { if (amount < 0) { diff --git a/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java b/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java index d108d95..a349782 100644 --- a/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java +++ b/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java @@ -87,6 +87,7 @@ public class ThrottledCursor extends AbstractCursor { } } + @Override public int skipNext(int amount) throws FetchException { if (amount <= 0) { if (amount < 0) { diff --git a/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java b/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java index 46dedd1..199cc84 100644 --- a/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java +++ b/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java @@ -103,6 +103,7 @@ public abstract class TransformedCursor extends AbstractCursor { throw new NoSuchElementException(); } + @Override public int skipNext(int amount) throws FetchException { if (amount <= 0) { if (amount < 0) { diff --git a/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java b/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java index 442d45c..32bf4e0 100644 --- a/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java +++ b/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java @@ -155,6 +155,7 @@ class WorkFilePool { String threadName = "MergeSortBuffer shutdown (" + tempDir + ')'; mShutdownHook = new Thread(threadName) { + @Override public void run() { // Notify users of work files and wait for them to close. synchronized (mWorkFileUsers) { -- cgit v1.2.3