[JGIT PATCH 06/21] Allow PackIndexWriter to use any subclass of PackedObjectInfo
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jun 29, 2008, 07:59 UTC
- Message-ID
- <1214726371-93520-7-git-send-email-spearce@spearce.org>
- In-Reply-To
- <1214726371-93520-6-git-send-email-spearce@spearce.org>
Some users of PackIndexWriter may have extended PackedObjectInfo to store additional implementation specific details, but wish to pass off their own subclass instances to avoid allocating even more memory.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org> --- .../src/org/spearce/jgit/lib/PackIndexWriter.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackIndexWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackIndexWriter.java index 3d0050d..567f099 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackIndexWriter.java +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackIndexWriter.java @@ -86,7 +86,7 @@ public abstract class PackIndexWriter { */ @SuppressWarnings("fallthrough") public static PackIndexWriter createOldestPossible(final OutputStream dst, - final List<PackedObjectInfo> objs) { + final List<? extends PackedObjectInfo> objs) { int version = 1; LOOP: for (final PackedObjectInfo oe : objs) { switch (version) { @@ -137,7 +137,7 @@ public abstract class PackIndexWriter { protected final byte[] tmp; /** The entries this writer must pack. */ - protected List<PackedObjectInfo> entries; + protected List<? extends PackedObjectInfo> entries; /** SHA-1 checksum for the entire pack data. */ protected byte[] packChecksum; @@ -172,7 +172,7 @@ public abstract class PackIndexWriter { * an error occurred while writing to the output stream, or this * index format cannot store the object data supplied. */ - public void write(final List<PackedObjectInfo> toStore, + public void write(final List<? extends PackedObjectInfo> toStore, final byte[] packDataChecksum) throws IOException { entries = toStore; packChecksum = packDataChecksum;
-- 1.5.6.74.g8a5e