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 87bd4b55b..54a2d8996 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(); } } }