From 44f64de09166bc361dea71c3730cd8ec70e86a87 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 5 Feb 2016 17:15:19 +0900 Subject: RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource Change-Id: I2341977223be1dc5252492f4775626122f56496b Signed-off-by: David Pursehouse --- .../tst/org/eclipse/jgit/revwalk/RevTagParseTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk') 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"); -- cgit v1.2.3