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:
parent
4cba10bee4
commit
ec72e8029e
|
@ -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,
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue