Browse Source

RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource

Change-Id: Iaa87c51bc19b4fa832393c11db20b69865d30d48
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
stable-4.2
David Pursehouse 9 years ago
parent
commit
5bfdc3341c
  1. 5
      org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java

5
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java

@ -452,9 +452,10 @@ public class RevCommitParseTest extends RepositoryTestCase {
@Test
public void testParse_PublicParseMethod()
throws UnsupportedEncodingException {
ObjectInserter.Formatter fmt = new ObjectInserter.Formatter();
CommitBuilder src = new CommitBuilder();
src.setTreeId(fmt.idFor(Constants.OBJ_TREE, new byte[] {}));
try (ObjectInserter.Formatter fmt = new ObjectInserter.Formatter()) {
src.setTreeId(fmt.idFor(Constants.OBJ_TREE, new byte[] {}));
}
src.setAuthor(author);
src.setCommitter(committer);
src.setMessage("Test commit\n\nThis is a test.\n");

Loading…
Cancel
Save