aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
index a3b4134aea..9e78921b79 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
@@ -125,16 +125,9 @@ public class PushConnectionTest {
Map<String, RemoteRefUpdate> updates = new HashMap<>();
updates.put(rru.getRemoteName(), rru);
- Transport tn = testProtocol.open(uri, client, "server");
- try {
- PushConnection connection = tn.openPush();
- try {
- connection.push(NullProgressMonitor.INSTANCE, updates);
- } finally {
- connection.close();
- }
- } finally {
- tn.close();
+ try (Transport tn = testProtocol.open(uri, client, "server");
+ PushConnection connection = tn.openPush()) {
+ connection.push(NullProgressMonitor.INSTANCE, updates);
}
assertEquals(REJECTED_OTHER_REASON, rru.getStatus());