From c111261158c6adabe3be9d7b4d9c54340f700bdb Mon Sep 17 00:00:00 2001 From: "jackdt@google.com" Date: Mon, 1 Apr 2024 10:46:15 -0700 Subject: [PATCH] DfsPackFile: Make the loader classes used to construct bitmaps public. This is necessary to swap out implementations of the PackBitmapIndex with custom implementations. Change-Id: Ia6f951bbc901446c255fa2902fab05d7ed974111 --- .../internal/storage/dfs/DfsPackFile.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java index 9095ce2542..5cc2a57aba 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java @@ -70,7 +70,10 @@ public final class DfsPackFile extends BlockBasedFile { private static final long REF_POSITION = 0; - private static final PackBitmapIndexLoader DEFAULT_BITMAP_LOADER = new StreamPackBitmapIndexLoader(); + /** + * Loader for the default file-based {@link PackBitmapIndex} implementation. + */ + public static final PackBitmapIndexLoader DEFAULT_BITMAP_LOADER = new StreamPackBitmapIndexLoader(); /** Index mapping {@link ObjectId} to position within the pack stream. */ private volatile PackIndex index; @@ -1382,12 +1385,22 @@ public final class DfsPackFile extends BlockBasedFile { * The bytes can be 0, if the implementation doesn't do any initial * loading. */ - class LoadResult { - final PackBitmapIndex bitmapIndex; - - final long bytesRead; - - LoadResult(PackBitmapIndex packBitmapIndex, long bytesRead) { + public class LoadResult { + /** The loaded {@link PackBitmapIndex}. */ + public final PackBitmapIndex bitmapIndex; + + /** The bytes read upon initial load (may be 0). */ + public final long bytesRead; + + /** + * Constructs the LoadResult. + * + * @param packBitmapIndex + * the loaded index. + * @param bytesRead + * the bytes read upon loading. + */ + public LoadResult(PackBitmapIndex packBitmapIndex, long bytesRead) { this.bitmapIndex = packBitmapIndex; this.bytesRead = bytesRead; } -- 2.39.5