Browse Source

Scanner: Open RevWalk in try-with-resource

Change-Id: Ieeec292c1346edbda2b26f021e75cbc1435bb9f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago
parent
commit
d11a40a14c
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftree/Scanner.java

5
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) {

Loading…
Cancel
Save