Fix resource leak in ChangeIdUtil
Change-Id: I5cb3e9c7e167248697932933eef925c446514683 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
d94ce9c754
commit
3f79182081
|
@ -115,9 +115,11 @@ public static ObjectId computeChangeId(final ObjectId treeId,
|
||||||
b.append(committer.toExternalString());
|
b.append(committer.toExternalString());
|
||||||
b.append("\n\n"); //$NON-NLS-1$
|
b.append("\n\n"); //$NON-NLS-1$
|
||||||
b.append(cleanMessage);
|
b.append(cleanMessage);
|
||||||
return new ObjectInserter.Formatter().idFor(Constants.OBJ_COMMIT, //
|
try (ObjectInserter f = new ObjectInserter.Formatter()) {
|
||||||
|
return f.idFor(Constants.OBJ_COMMIT, //
|
||||||
b.toString().getBytes(Constants.CHARACTER_ENCODING));
|
b.toString().getBytes(Constants.CHARACTER_ENCODING));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static final Pattern issuePattern = Pattern
|
private static final Pattern issuePattern = Pattern
|
||||||
.compile("^(Bug|Issue)[a-zA-Z0-9-]*:.*$"); //$NON-NLS-1$
|
.compile("^(Bug|Issue)[a-zA-Z0-9-]*:.*$"); //$NON-NLS-1$
|
||||||
|
|
Loading…
Reference in New Issue