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

Change-Id: I2341977223be1dc5252492f4775626122f56496b
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
This commit is contained in:
David Pursehouse 2016-02-05 17:15:19 +09:00
parent 895510fc48
commit 44f64de091
1 changed files with 4 additions and 3 deletions

View File

@ -463,10 +463,11 @@ public void testParse_GitStyleMessage() throws Exception {
@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");