Merge "Fix resource leak in ChangeIdUtil"

This commit is contained in:
Shawn Pearce 2015-04-08 16:08:41 -04:00 committed by Gerrit Code Review @ Eclipse.org
commit f4ded63880
1 changed files with 4 additions and 2 deletions

View File

@ -115,8 +115,10 @@ public static ObjectId computeChangeId(final ObjectId treeId,
b.append(committer.toExternalString());
b.append("\n\n"); //$NON-NLS-1$
b.append(cleanMessage);
return new ObjectInserter.Formatter().idFor(Constants.OBJ_COMMIT, //
b.toString().getBytes(Constants.CHARACTER_ENCODING));
try (ObjectInserter f = new ObjectInserter.Formatter()) {
return f.idFor(Constants.OBJ_COMMIT, //
b.toString().getBytes(Constants.CHARACTER_ENCODING));
}
}
private static final Pattern issuePattern = Pattern