From f849b8d0d928f37796065a6d6073f9af8331d06b Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Nov 2022 20:32:37 +0100 Subject: [PATCH] Silence warnings about unclosed BasePackPushConnection Change-Id: If52e8462e6222dd58d1004dd5ac174a27d96d098 --- .../tst/org/eclipse/jgit/transport/TransportTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java index 2019c263fb..b1344b7aa2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java @@ -248,6 +248,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { try (Transport transport = Transport.open(uri)) { try (PushConnection pushConnection = transport.openPush()) { assertTrue(pushConnection instanceof BasePackPushConnection); + @SuppressWarnings("resource") BasePackPushConnection basePackPushConnection = (BasePackPushConnection) pushConnection; assertEquals(true, basePackPushConnection.isUseBitmaps()); } @@ -257,6 +258,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { transport.setPushUseBitmaps(true); try (PushConnection pushConnection = transport.openPush()) { assertTrue(pushConnection instanceof BasePackPushConnection); + @SuppressWarnings("resource") BasePackPushConnection basePackPushConnection = (BasePackPushConnection) pushConnection; assertEquals(true, basePackPushConnection.isUseBitmaps()); } @@ -266,6 +268,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { transport.setPushUseBitmaps(false); try (PushConnection pushConnection = transport.openPush()) { assertTrue(pushConnection instanceof BasePackPushConnection); + @SuppressWarnings("resource") BasePackPushConnection basePackPushConnection = (BasePackPushConnection) pushConnection; assertEquals(false, basePackPushConnection.isUseBitmaps()); } -- 2.39.5