Browse Source

Patch: Open TemporaryBuffer in try-with-resource

Change-Id: I90bff8d49ecc37b8c10ce909cd3ac563205b641c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago committed by Matthias Sohn
parent
commit
86330ca2ad
  1. 4
      org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java

4
org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java

@ -152,11 +152,11 @@ public class Patch {
}
private static byte[] readFully(final InputStream is) throws IOException {
TemporaryBuffer b = new TemporaryBuffer.Heap(Integer.MAX_VALUE);
try (TemporaryBuffer b = new TemporaryBuffer.Heap(Integer.MAX_VALUE)) {
b.copy(is);
b.close();
return b.toByteArray();
}
}
/**
* Parse a patch stored in a byte[].

Loading…
Cancel
Save