diff options
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java index 2ef0f20d8d..2fa59f3cd3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java @@ -221,10 +221,11 @@ class Scanner { return new SymbolicRef(ref.getName(), dst); } - @SuppressWarnings("resource") private static RevTree toTree(ObjectReader reader, AnyObjectId id) throws IOException { - return new RevWalk(reader).parseTree(id); + try (RevWalk rw = new RevWalk(reader)) { + return rw.parseTree(id); + } } private static boolean curElementHasPeelSuffix(AbstractTreeIterator itr) { |