Browse Source

DirCacheIterator: Open InputStream in try-with-resource

Change-Id: I05d2d1de9a3d39466a6880f6e8107da8681876b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
da63121b0d
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java

5
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java vendored

@ -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;

Loading…
Cancel
Save