aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 09:47:11 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 09:47:11 +0900
commit18263417934cc6d080916aea7bf56c8206a2b0c9 (patch)
treeb648dc8e96dfcea6c8a71f0dac4b535404345939 /org.eclipse.jgit/src/org/eclipse
parent06fbd7c5fa9f0f5a32825c96a16be503a28915be (diff)
downloadjgit-18263417934cc6d080916aea7bf56c8206a2b0c9.tar.gz
jgit-18263417934cc6d080916aea7bf56c8206a2b0c9.zip
DefaultNoteMerger: Open UnionInputStream in try-with-resource
Change-Id: I035aa89cdbf235992f41e752f49d735be4e5df0a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java
index 87bd4b55b1..54a2d8996a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/DefaultNoteMerger.java
@@ -82,14 +82,11 @@ public class DefaultNoteMerger implements NoteMerger {
ObjectLoader lo = reader.open(ours.getData());
ObjectLoader lt = reader.open(theirs.getData());
- UnionInputStream union = new UnionInputStream(lo.openStream(),
- lt.openStream());
- try {
+ try (UnionInputStream union = new UnionInputStream(lo.openStream(),
+ lt.openStream())) {
ObjectId noteData = inserter.insert(Constants.OBJ_BLOB,
lo.getSize() + lt.getSize(), union);
return new Note(ours, noteData);
- } finally {
- union.close();
}
}
}