diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java index 68521d398..d768216db 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java @@ -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;