summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 13:31:32 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 16:56:13 +0900
commitda63121b0db30cfe569bf5b7138356bebccd253b (patch)
tree896498df48a1e0ddcf2ca11751dd261f5c6706b1
parentef9046fa89038ad3801af1194fbb492b66e0b62b (diff)
downloadjgit-da63121b0db30cfe569bf5b7138356bebccd253b.tar.gz
jgit-da63121b0db30cfe569bf5b7138356bebccd253b.zip
DirCacheIterator: Open InputStream in try-with-resource
Change-Id: I05d2d1de9a3d39466a6880f6e8107da8681876b1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheIterator.java5
1 files changed, 1 insertions, 4 deletions
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 68521d3981..d768216db6 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;