diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java index ea904cd1d..79fbb09ec 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/FanoutBucket.java @@ -260,8 +260,8 @@ class FanoutBucket extends InMemoryNoteBucket { } ObjectId getTreeId() { - try { - return new ObjectInserter.Formatter().idFor(build(false, null)); + try (ObjectInserter.Formatter f = new ObjectInserter.Formatter()) { + return f.idFor(build(false, null)); } catch (IOException e) { // should never happen as we are not inserting throw new RuntimeException(e);