From 421e69a4a02c0b8aa82ca7421af10246f22c389a Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Tue, 10 Mar 2015 15:24:47 -0700 Subject: [PATCH] TreeWalk: Stop using deprecated ObjectReader#release() Change-Id: I334034a2991a07664302bc8d1f3dead85c2caffe --- org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java index 577c9e303..3ecef453e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java @@ -157,11 +157,8 @@ public class TreeWalk implements AutoCloseable { public static TreeWalk forPath(final Repository db, final String path, final AnyObjectId... trees) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { - ObjectReader reader = db.newObjectReader(); - try { + try (ObjectReader reader = db.newObjectReader()) { return forPath(reader, path, trees); - } finally { - reader.release(); } }