diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2019-01-21 15:20:25 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2019-01-21 15:20:25 +0900 |
commit | ec72e8029ebbb28b37fef5c3d84a2bb55e788203 (patch) | |
tree | 1db2359de62fb0d70f2716bcb0cc3fc18d899324 | |
parent | 4cba10bee4cd0f54ce2087bffce927acc458f205 (diff) | |
download | jgit-ec72e8029ebbb28b37fef5c3d84a2bb55e788203.tar.gz jgit-ec72e8029ebbb28b37fef5c3d84a2bb55e788203.zip |
SmartClientSmartServerTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I7005f5821394a3e237cf877cf38557b6a62cacb3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r-- | org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index 5089770421..420e489712 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -1169,9 +1169,11 @@ public class SmartClientSmartServerTest extends HttpTestCase { @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); |