From a5ec41bd2822c5d926d4f75454b784917efb7941 Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Mon, 25 Mar 2024 10:52:26 -0700 Subject: PackBitmapIndex: convert from class to interface This abstract class can be an interface after https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1184614 moved the packChecksum data behind a getter interface. This also allows easier overriding of this interface with custom types. Change-Id: I89851de678e7ff896cc086455907e2898d2eecf6 --- .../org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java | 2 +- .../src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java | 4 ++-- .../eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'org.eclipse.jgit/src') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java index c2b3926309..5f979b0daa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/BasePackBitmapIndex.java @@ -18,7 +18,7 @@ import com.googlecode.javaewah.EWAHCompressedBitmap; /** * Base implementation of the PackBitmapIndex. */ -abstract class BasePackBitmapIndex extends PackBitmapIndex { +abstract class BasePackBitmapIndex implements PackBitmapIndex { private final ObjectIdOwnerMap bitmaps; BasePackBitmapIndex(ObjectIdOwnerMap bitmaps) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java index affd2c0761..4c3f6c1eb4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndex.java @@ -35,7 +35,7 @@ import com.googlecode.javaewah.EWAHCompressedBitmap; * {@link #findPosition(AnyObjectId)} can be used to build other bitmaps that a * compatible with the encoded bitmaps available from the index. */ -public abstract class PackBitmapIndex { +public interface PackBitmapIndex { /** Flag bit denoting the bitmap should be reused during index creation. */ public static final int FLAG_REUSE = 1; @@ -137,7 +137,7 @@ public abstract class PackBitmapIndex { * * @return checksum as a byte array */ - byte[] getPackChecksum() { + default byte[] getPackChecksum() { return null; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java index bb7cfd0464..ffbc0737ac 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexRemapper.java @@ -28,8 +28,8 @@ import com.googlecode.javaewah.IntIterator; * implementations this implementation is not thread safe, as it is intended to * be used with a PackBitmapIndexBuilder, which is also not thread safe. */ -public class PackBitmapIndexRemapper extends PackBitmapIndex - implements Iterable { +public class PackBitmapIndexRemapper + implements PackBitmapIndex, Iterable { private final BasePackBitmapIndex oldPackIndex; final PackBitmapIndex newPackIndex; -- cgit v1.2.3