This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 7564209440091169f62b625f9e9d4bc597c54fb8 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Oct 29 09:56:30 2023 -0400 Use try-with-resources --- .../compress/harmony/pack200/tests/ArchiveTest.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/ArchiveTest.java b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/ArchiveTest.java index b48d3285..4e112c3f 100755 --- a/src/test/java/org/apache/commons/compress/harmony/pack200/tests/ArchiveTest.java +++ b/src/test/java/org/apache/commons/compress/harmony/pack200/tests/ArchiveTest.java @@ -118,14 +118,12 @@ public class ArchiveTest { @Test public void testAlternativeConstructor() throws IOException, URISyntaxException, Pack200Exception { - final JarInputStream inStream = new JarInputStream(new FileInputStream( - new File(Archive.class.getResource( - "/pack200/sqlUnpacked.jar").toURI()))); - file = File.createTempFile("sql", ".pack.gz"); - file.deleteOnExit(); - out = new FileOutputStream(file); - new Archive(inStream, out, null).pack(); - inStream.close(); + try (JarInputStream inStream = new JarInputStream(new FileInputStream(new File(Archive.class.getResource("/pack200/sqlUnpacked.jar").toURI())))) { + file = File.createTempFile("sql", ".pack.gz"); + file.deleteOnExit(); + out = new FileOutputStream(file); + new Archive(inStream, out, null).pack(); + } out.close(); }