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 @Test
public void testInvalidWant() throws Exception { public void testInvalidWant() throws Exception {
@SuppressWarnings("resource") ObjectId id;
ObjectId id = new ObjectInserter.Formatter().idFor(Constants.OBJ_BLOB, try (ObjectInserter.Formatter formatter = new ObjectInserter.Formatter()) {
"testInvalidWant".getBytes(UTF_8)); id = formatter.idFor(Constants.OBJ_BLOB,
"testInvalidWant".getBytes(UTF_8));
}
Repository dst = createBareRepository(); Repository dst = createBareRepository();
try (Transport t = Transport.open(dst, remoteURI); try (Transport t = Transport.open(dst, remoteURI);