Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Arès2015-05-28 19:59:48 +0000
committerHugo Arès2015-05-28 20:07:23 +0000
commit663ccd76f04017dab216825e9b72a962759ba2e4 (patch)
treebe6f6ea8a7ffab9d368bc709be7f7e9e177084ec
parenta3468f87cb571d7c1b71fc682631a5fc9d38bdf6 (diff)
downloadjgit-663ccd76f04017dab216825e9b72a962759ba2e4.tar.gz
jgit-663ccd76f04017dab216825e9b72a962759ba2e4.tar.xz
jgit-663ccd76f04017dab216825e9b72a962759ba2e4.zip
Close WindowCursor using try-with-resources in UnpackedObject
Change-Id: I187403ed432f7d6b1e84223918bd72d895e6bdfe Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java5
1 files changed, 1 insertions, 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 cb7d912593..e4cc697962 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();
}
}

Back to the top