aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
index 3a1fa24009..026492f7b6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
@@ -3015,12 +3015,13 @@ public class UploadPackTest {
String version = TransferConfig.ProtocolVersion.V2.version();
server.getConfig().setString(ConfigConstants.CONFIG_PROTOCOL_SECTION,
null, ConfigConstants.CONFIG_KEY_VERSION, version);
- UploadPack up = new UploadPack(server);
- up.setExtraParameters(Sets.of("version=".concat(version)));
+ try (UploadPack up = new UploadPack(server)) {
+ up.setExtraParameters(Sets.of("version=".concat(version)));
- ByteArrayOutputStream recv = new ByteArrayOutputStream();
- up.upload(send, recv, null);
- return up.getStatistics();
+ ByteArrayOutputStream recv = new ByteArrayOutputStream();
+ up.upload(send, recv, null);
+ return up.getStatistics();
+ }
}
@Test