Browse Source

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
stable-4.2
Jonathan Nieder 9 years ago
parent
commit
424aa22b56
  1. 16
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java

16
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java

@ -85,6 +85,7 @@ public class BitmapIndexImpl implements BitmapIndex {
return packIndex; return packIndex;
} }
@Override
public CompressedBitmap getBitmap(AnyObjectId objectId) { public CompressedBitmap getBitmap(AnyObjectId objectId) {
EWAHCompressedBitmap compressed = packIndex.getBitmap(objectId); EWAHCompressedBitmap compressed = packIndex.getBitmap(objectId);
if (compressed == null) if (compressed == null)
@ -103,6 +104,7 @@ public class BitmapIndexImpl implements BitmapIndex {
return new CompressedBitmap(b); return new CompressedBitmap(b);
} }
@Override
public CompressedBitmapBuilder newBitmapBuilder() { public CompressedBitmapBuilder newBitmapBuilder() {
return new CompressedBitmapBuilder(); return new CompressedBitmapBuilder();
} }
@ -211,6 +213,7 @@ public class BitmapIndexImpl implements BitmapIndex {
private final class CompressedBitmapBuilder implements BitmapBuilder { private final class CompressedBitmapBuilder implements BitmapBuilder {
private ComboBitset bitset = new ComboBitset(); private ComboBitset bitset = new ComboBitset();
@Override
public boolean add(AnyObjectId objectId, int type) { public boolean add(AnyObjectId objectId, int type) {
int position = addObject(objectId, type); int position = addObject(objectId, type);
if (bitset.contains(position)) if (bitset.contains(position))
@ -226,17 +229,20 @@ public class BitmapIndexImpl implements BitmapIndex {
return true; return true;
} }
@Override
public boolean contains(AnyObjectId objectId) { public boolean contains(AnyObjectId objectId) {
int position = findPosition(objectId); int position = findPosition(objectId);
return 0 <= position && bitset.contains(position); return 0 <= position && bitset.contains(position);
} }
@Override
public void remove(AnyObjectId objectId) { public void remove(AnyObjectId objectId) {
int position = findPosition(objectId); int position = findPosition(objectId);
if (0 <= position) if (0 <= position)
bitset.remove(position); bitset.remove(position);
} }
@Override
public CompressedBitmapBuilder or(Bitmap other) { public CompressedBitmapBuilder or(Bitmap other) {
if (isSameCompressedBitmap(other)) { if (isSameCompressedBitmap(other)) {
bitset.or(((CompressedBitmap) other).bitmap); bitset.or(((CompressedBitmap) other).bitmap);
@ -249,6 +255,7 @@ public class BitmapIndexImpl implements BitmapIndex {
return this; return this;
} }
@Override
public CompressedBitmapBuilder andNot(Bitmap other) { public CompressedBitmapBuilder andNot(Bitmap other) {
if (isSameCompressedBitmap(other)) { if (isSameCompressedBitmap(other)) {
bitset.andNot(((CompressedBitmap) other).bitmap); bitset.andNot(((CompressedBitmap) other).bitmap);
@ -261,6 +268,7 @@ public class BitmapIndexImpl implements BitmapIndex {
return this; return this;
} }
@Override
public CompressedBitmapBuilder xor(Bitmap other) { public CompressedBitmapBuilder xor(Bitmap other) {
if (isSameCompressedBitmap(other)) { if (isSameCompressedBitmap(other)) {
bitset.xor(((CompressedBitmap) other).bitmap); bitset.xor(((CompressedBitmap) other).bitmap);
@ -274,18 +282,22 @@ public class BitmapIndexImpl implements BitmapIndex {
} }
/** @return the fully built immutable bitmap */ /** @return the fully built immutable bitmap */
@Override
public CompressedBitmap build() { public CompressedBitmap build() {
return new CompressedBitmap(bitset.combine()); return new CompressedBitmap(bitset.combine());
} }
@Override
public Iterator<BitmapObject> iterator() { public Iterator<BitmapObject> iterator() {
return build().iterator(); return build().iterator();
} }
@Override
public int cardinality() { public int cardinality() {
return bitset.combine().cardinality(); return bitset.combine().cardinality();
} }
@Override
public boolean removeAllOrNone(PackBitmapIndex index) { public boolean removeAllOrNone(PackBitmapIndex index) {
if (!packIndex.equals(index)) if (!packIndex.equals(index))
return false; return false;
@ -312,14 +324,17 @@ public class BitmapIndexImpl implements BitmapIndex {
this.bitmap = bitmap; this.bitmap = bitmap;
} }
@Override
public CompressedBitmap or(Bitmap other) { public CompressedBitmap or(Bitmap other) {
return new CompressedBitmap(bitmap.or(bitmapOf(other))); return new CompressedBitmap(bitmap.or(bitmapOf(other)));
} }
@Override
public CompressedBitmap andNot(Bitmap other) { public CompressedBitmap andNot(Bitmap other) {
return new CompressedBitmap(bitmap.andNot(bitmapOf(other))); return new CompressedBitmap(bitmap.andNot(bitmapOf(other)));
} }
@Override
public CompressedBitmap xor(Bitmap other) { public CompressedBitmap xor(Bitmap other) {
return new CompressedBitmap(bitmap.xor(bitmapOf(other))); return new CompressedBitmap(bitmap.xor(bitmapOf(other)));
} }
@ -338,6 +353,7 @@ public class BitmapIndexImpl implements BitmapIndex {
return packIndex.ofObjectType(bitmap, type).intIterator(); return packIndex.ofObjectType(bitmap, type).intIterator();
} }
@Override
public Iterator<BitmapObject> iterator() { public Iterator<BitmapObject> iterator() {
final IntIterator dynamic = bitmap.andNot(ones(indexObjectCount)) final IntIterator dynamic = bitmap.andNot(ones(indexObjectCount))
.intIterator(); .intIterator();

Loading…
Cancel
Save