From 663ccd76f04017dab216825e9b72a962759ba2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Ar=C3=A8s?= Date: Thu, 28 May 2015 15:59:48 -0400 Subject: [PATCH] Close WindowCursor using try-with-resources in UnpackedObject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I187403ed432f7d6b1e84223918bd72d895e6bdfe Signed-off-by: Hugo Arès --- .../eclipse/jgit/internal/storage/file/UnpackedObject.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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(); } }