diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 20:10:12 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-05 20:10:12 +0900 |
commit | c633ea2ac4762de1b4cbe7101f3da86081f958ab (patch) | |
tree | 0b332884bc36a34d3a705bdddeb52aae9eb73ff2 /org.eclipse.jgit.http.test | |
parent | 3b250b371b9cd097c49f30894fe335487c3400fd (diff) | |
download | jgit-c633ea2ac4762de1b4cbe7101f3da86081f958ab.tar.gz jgit-c633ea2ac4762de1b4cbe7101f3da86081f958ab.zip |
AdvertiseErrorTest: Open Transport in try-with-resource
Change-Id: I78adec7baf82d1a0eedc10e90b6d4f20008a046d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.http.test')
-rw-r--r-- | org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java index 0e92b1460c..5a46967766 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java @@ -135,8 +135,7 @@ public class AdvertiseErrorTest extends HttpTestCase { final RevCommit Q = src.commit().add("Q", Q_txt).create(); final Repository db = src.getRepository(); final String dstName = Constants.R_HEADS + "new.branch"; - final Transport t = Transport.open(db, remoteURI); - try { + try (Transport t = Transport.open(db, remoteURI)) { final String srcExpr = Q.name(); final boolean forceUpdate = false; final String localName = null; @@ -154,8 +153,6 @@ public class AdvertiseErrorTest extends HttpTestCase { + "come back next year!", // error.getMessage()); } - } finally { - t.close(); } } } |