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

Change-Id: I7005f5821394a3e237cf877cf38557b6a62cacb3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2019-01-21 15:20:25 +09:00
parent 4cba10bee4
commit ec72e8029e
1 changed files with 5 additions and 3 deletions

View File

@ -1169,9 +1169,11 @@ public void testInitialClone_BrokenServer() throws Exception {
@Test
public void testInvalidWant() throws Exception {
@SuppressWarnings("resource")
ObjectId id = new ObjectInserter.Formatter().idFor(Constants.OBJ_BLOB,
"testInvalidWant".getBytes(UTF_8));
ObjectId id;
try (ObjectInserter.Formatter formatter = new ObjectInserter.Formatter()) {
id = formatter.idFor(Constants.OBJ_BLOB,
"testInvalidWant".getBytes(UTF_8));
}
Repository dst = createBareRepository();
try (Transport t = Transport.open(dst, remoteURI);