]> source.dussan.org Git - jgit.git/commitdiff
DirCacheIterator: Open InputStream in try-with-resource 43/118743/3
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 6 Mar 2018 04:31:32 +0000 (13:31 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 6 Mar 2018 07:56:13 +0000 (16:56 +0900)
Change-Id: I05d2d1de9a3d39466a6880f6e8107da8681876b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java

index 68521d398110b30f7588ee80f1c8cf72b1ae8be9..d768216db6a32fb71ef8b22cc89b9d73431d074e 100644 (file)
@@ -329,11 +329,8 @@ public class DirCacheIterator extends AbstractTreeIterator {
                        AttributesNode r = new AttributesNode();
                        ObjectLoader loader = reader.open(objectId);
                        if (loader != null) {
-                               InputStream in = loader.openStream();
-                               try {
+                               try (InputStream in = loader.openStream()) {
                                        r.parse(in);
-                               } finally {
-                                       in.close();
                                }
                        }
                        return r.getRules().isEmpty() ? null : r;