]> source.dussan.org Git - jgit.git/commitdiff
Remove pointless size test in PackFile decompress 45/1045/2
authorShawn O. Pearce <spearce@spearce.org>
Fri, 2 Jul 2010 23:56:31 +0000 (16:56 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 3 Jul 2010 17:54:30 +0000 (10:54 -0700)
Now that any large objects are forced through a streaming loader
when its bigger than getStreamFileThreshold(), and that threshold
is pegged at Integer.MAX_VALUE as its largest size, we will never
be able to reach this code path where we threw OutOfMemoryError.

Robin pointed out that we probably should include a message here,
but the code is effectively unreachable, so there isn't any value
in adding a message at this point.

So remove it.

Change-Id: Ie611d005622e38a75537f1350246df0ab89dd500
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/PackFile.java

index dc1fff4bc5669e99bf042a7993e2978c06bc0363..40bb07100cde87affaed9cb6dbb9f81162ee434a 100644 (file)
@@ -277,8 +277,6 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
 
        private final byte[] decompress(final long position, final long totalSize,
                        final WindowCursor curs) throws IOException, DataFormatException {
-               if (totalSize > Integer.MAX_VALUE)
-                       throw new OutOfMemoryError();
                final byte[] dstbuf = new byte[(int) totalSize];
                if (curs.inflate(this, position, dstbuf, 0) != totalSize)
                        throw new EOFException(MessageFormat.format(JGitText.get().shortCompressedStreamAt, position));