diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2016-02-05 17:15:19 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2016-02-05 17:15:19 +0900 |
commit | 44f64de09166bc361dea71c3730cd8ec70e86a87 (patch) | |
tree | 04a069eab2dda0efeabbdcf566ac03cccab89b92 | |
parent | 895510fc48623d2463c84cf85c38d7697cf21006 (diff) | |
download | jgit-44f64de09166bc361dea71c3730cd8ec70e86a87.tar.gz jgit-44f64de09166bc361dea71c3730cd8ec70e86a87.zip |
RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I2341977223be1dc5252492f4775626122f56496b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java index 82505caf22..f97043b7e8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java @@ -463,10 +463,11 @@ public class RevTagParseTest extends RepositoryTestCase { @Test public void testParse_PublicParseMethod() throws CorruptObjectException { - ObjectInserter.Formatter fmt = new ObjectInserter.Formatter(); TagBuilder src = new TagBuilder(); - src.setObjectId(fmt.idFor(Constants.OBJ_TREE, new byte[] {}), - Constants.OBJ_TREE); + try (ObjectInserter.Formatter fmt = new ObjectInserter.Formatter()) { + src.setObjectId(fmt.idFor(Constants.OBJ_TREE, new byte[] {}), + Constants.OBJ_TREE); + } src.setTagger(committer); src.setTag("a.test"); src.setMessage("Test tag\n\nThis is a test.\n"); |