diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java index cb7d91259..e4cc69796 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java +++ b/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) throws IOException { - WindowCursor wc = new WindowCursor(null); - try { + try (WindowCursor wc = new WindowCursor(null)) { return open(new ByteArrayInputStream(raw), null, id, wc); - } finally { - wc.close(); } }