From 424aa22b56eb4559879c8439fcff9445fb8237da Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 3 Nov 2015 18:38:18 -0800 Subject: [PATCH] Add @Override annotations to BitmapIndexImpl This makes it easier to distinguish between implementations of methods from the interface from helpers internal to org.eclipse.jgit.internal.storage.*. This was illegal in Java 5 but JGit requires newer Java these days. Change-Id: I92c65f3407a334acddd32ec9e09ab7d1d39c4dc6 --- .../internal/storage/file/BitmapIndexImpl.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java index 0f724af0d2..184a9c1dd6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java @@ -85,6 +85,7 @@ public class BitmapIndexImpl implements BitmapIndex { return packIndex; } + @Override public CompressedBitmap getBitmap(AnyObjectId objectId) { EWAHCompressedBitmap compressed = packIndex.getBitmap(objectId); if (compressed == null) @@ -103,6 +104,7 @@ public class BitmapIndexImpl implements BitmapIndex { return new CompressedBitmap(b); } + @Override public CompressedBitmapBuilder newBitmapBuilder() { return new CompressedBitmapBuilder(); } @@ -211,6 +213,7 @@ public class BitmapIndexImpl implements BitmapIndex { private final class CompressedBitmapBuilder implements BitmapBuilder { private ComboBitset bitset = new ComboBitset(); + @Override public boolean add(AnyObjectId objectId, int type) { int position = addObject(objectId, type); if (bitset.contains(position)) @@ -226,17 +229,20 @@ public class BitmapIndexImpl implements BitmapIndex { return true; } + @Override public boolean contains(AnyObjectId objectId) { int position = findPosition(objectId); return 0 <= position && bitset.contains(position); } + @Override public void remove(AnyObjectId objectId) { int position = findPosition(objectId); if (0 <= position) bitset.remove(position); } + @Override public CompressedBitmapBuilder or(Bitmap other) { if (isSameCompressedBitmap(other)) { bitset.or(((CompressedBitmap) other).bitmap); @@ -249,6 +255,7 @@ public class BitmapIndexImpl implements BitmapIndex { return this; } + @Override public CompressedBitmapBuilder andNot(Bitmap other) { if (isSameCompressedBitmap(other)) { bitset.andNot(((CompressedBitmap) other).bitmap); @@ -261,6 +268,7 @@ public class BitmapIndexImpl implements BitmapIndex { return this; } + @Override public CompressedBitmapBuilder xor(Bitmap other) { if (isSameCompressedBitmap(other)) { bitset.xor(((CompressedBitmap) other).bitmap); @@ -274,18 +282,22 @@ public class BitmapIndexImpl implements BitmapIndex { } /** @return the fully built immutable bitmap */ + @Override public CompressedBitmap build() { return new CompressedBitmap(bitset.combine()); } + @Override public Iterator iterator() { return build().iterator(); } + @Override public int cardinality() { return bitset.combine().cardinality(); } + @Override public boolean removeAllOrNone(PackBitmapIndex index) { if (!packIndex.equals(index)) return false; @@ -312,14 +324,17 @@ public class BitmapIndexImpl implements BitmapIndex { this.bitmap = bitmap; } + @Override public CompressedBitmap or(Bitmap other) { return new CompressedBitmap(bitmap.or(bitmapOf(other))); } + @Override public CompressedBitmap andNot(Bitmap other) { return new CompressedBitmap(bitmap.andNot(bitmapOf(other))); } + @Override public CompressedBitmap xor(Bitmap other) { return new CompressedBitmap(bitmap.xor(bitmapOf(other))); } @@ -338,6 +353,7 @@ public class BitmapIndexImpl implements BitmapIndex { return packIndex.ofObjectType(bitmap, type).intIterator(); } + @Override public Iterator iterator() { final IntIterator dynamic = bitmap.andNot(ones(indexObjectCount)) .intIterator(); -- 2.39.5