Browse Source

Close WindowCursor using try-with-resources in UnpackedObject

Change-Id: I187403ed432f7d6b1e84223918bd72d895e6bdfe
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
stable-4.1
Hugo Arès 10 years ago
parent
commit
663ccd76f0
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java

5
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java

@ -91,11 +91,8 @@ public class UnpackedObject {
*/ */
public static ObjectLoader parse(byte[] raw, AnyObjectId id) public static ObjectLoader parse(byte[] raw, AnyObjectId id)
throws IOException { throws IOException {
WindowCursor wc = new WindowCursor(null); try (WindowCursor wc = new WindowCursor(null)) {
try {
return open(new ByteArrayInputStream(raw), null, id, wc); return open(new ByteArrayInputStream(raw), null, id, wc);
} finally {
wc.close();
} }
} }

Loading…
Cancel
Save