diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-06 13:31:32 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-06 16:56:13 +0900 |
commit | da63121b0db30cfe569bf5b7138356bebccd253b (patch) | |
tree | 896498df48a1e0ddcf2ca11751dd261f5c6706b1 | |
parent | ef9046fa89038ad3801af1194fbb492b66e0b62b (diff) | |
download | jgit-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.java | 5 |
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; |