Browse Source

AdvertiseErrorTest: Open Transport in try-with-resource

Change-Id: I78adec7baf82d1a0eedc10e90b6d4f20008a046d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
c633ea2ac4
  1. 5
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java

5
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 RevCommit Q = src.commit().add("Q", Q_txt).create();
final Repository db = src.getRepository(); final Repository db = src.getRepository();
final String dstName = Constants.R_HEADS + "new.branch"; final String dstName = Constants.R_HEADS + "new.branch";
final Transport t = Transport.open(db, remoteURI); try (Transport t = Transport.open(db, remoteURI)) {
try {
final String srcExpr = Q.name(); final String srcExpr = Q.name();
final boolean forceUpdate = false; final boolean forceUpdate = false;
final String localName = null; final String localName = null;
@ -154,8 +153,6 @@ public class AdvertiseErrorTest extends HttpTestCase {
+ "come back next year!", // + "come back next year!", //
error.getMessage()); error.getMessage());
} }
} finally {
t.close();
} }
} }
} }

Loading…
Cancel
Save