Browse Source

Merge "Fix resource leak in ChangeIdUtil"

stable-4.1
Shawn Pearce 10 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
f4ded63880
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java

6
org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java

@ -115,8 +115,10 @@ public class ChangeIdUtil {
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

Loading…
Cancel
Save