]> source.dussan.org Git - jgit.git/commitdiff
TreeWalk: Stop using deprecated ObjectReader#release() 16/43616/2
authorDave Borowitz <dborowitz@google.com>
Tue, 10 Mar 2015 22:24:47 +0000 (15:24 -0700)
committerDave Borowitz <dborowitz@google.com>
Tue, 10 Mar 2015 23:27:22 +0000 (16:27 -0700)
Change-Id: I334034a2991a07664302bc8d1f3dead85c2caffe

org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java

index 577c9e303d1d94ba6a76a9a07307ba8b0ab62677..3ecef453e6faad04e50a4832dbbd93ccd87a0cc1 100644 (file)
@@ -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();
                }
        }