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. 8
      org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java

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

@ -152,10 +152,10 @@ public class Patch {
} }
private static byte[] readFully(final InputStream is) throws IOException { 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.copy(is);
b.close(); return b.toByteArray();
return b.toByteArray(); }
} }
/** /**

Loading…
Cancel
Save