DefaultNoteMerger: Open UnionInputStream in try-with-resource
Change-Id: I035aa89cdbf235992f41e752f49d735be4e5df0a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
06fbd7c5fa
commit
1826341793
|
@ -82,14 +82,11 @@ public Note merge(Note base, Note ours, Note theirs, ObjectReader reader,
|
|||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue