]> source.dussan.org Git - jgit.git/commitdiff
Close WindowCursor using try-with-resources in UnpackedObject 08/48908/1
authorHugo Arès <hugo.ares@ericsson.com>
Thu, 28 May 2015 19:59:48 +0000 (15:59 -0400)
committerHugo Arès <hugo.ares@ericsson.com>
Thu, 28 May 2015 20:07:23 +0000 (16:07 -0400)
Change-Id: I187403ed432f7d6b1e84223918bd72d895e6bdfe
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java

index cb7d91259304c1176967092ea0f0f0080e9db936..e4cc6979626d73d95e05dab170e0a8e340fd5ed4 100644 (file)
@@ -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();
                }
        }