diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java index 0b5efd77d..feecbd81c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java @@ -709,11 +709,12 @@ public class ObjectChecker { return ptr; } - @SuppressWarnings("resource") @Nullable private ObjectId idFor(int objType, byte[] raw) { if (skipList != null) { - return new ObjectInserter.Formatter().idFor(objType, raw); + try (ObjectInserter.Formatter fmt = new ObjectInserter.Formatter()) { + return fmt.idFor(objType, raw); + } } return null; }