aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-07 14:43:51 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-07 14:43:51 +0900
commit057a295f0c88613d1a8d45e07be07e2d59c21150 (patch)
tree932c0a403e6ac12751d346a27cee5c880936cb95
parent658c7c179d8718214f047886787ac27889e4331d (diff)
downloadjgit-057a295f0c88613d1a8d45e07be07e2d59c21150.tar.gz
jgit-057a295f0c88613d1a8d45e07be07e2d59c21150.zip
MeasurePackSizeTest: Open Transport in try-with-resource
Change-Id: If9a39f8eabe1cd3474bdc025ac92218cd2dd1640 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java
index 4c08ec2637..0415bcbb55 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/MeasurePackSizeTest.java
@@ -144,11 +144,9 @@ public class MeasurePackSizeTest 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";
- Transport t;
PushResult result;
- 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;
@@ -158,8 +156,6 @@ public class MeasurePackSizeTest extends HttpTestCase {
srcExpr, dstName, forceUpdate, localName, oldId);
result = t.push(NullProgressMonitor.INSTANCE,
Collections.singleton(update));
- } finally {
- t.close();
}
assertEquals("expected 1 RemoteUpdate", 1, result.getRemoteUpdates()
.size());