Browse Source

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

Change-Id: I7005f5821394a3e237cf877cf38557b6a62cacb3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.4
David Pursehouse 6 years ago
parent
commit
ec72e8029e
  1. 8
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java

8
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java

@ -1169,9 +1169,11 @@ public class SmartClientSmartServerTest extends HttpTestCase {
@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);

Loading…
Cancel
Save