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
The following commit(s) were added to refs/heads/master by this push: new 0dbe53b1a Use try-with-resources 0dbe53b1a is described below commit 0dbe53b1a1a9c226594fbb7fb6754fa7ae2528b5 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri May 17 10:19:20 2024 -0400 Use try-with-resources --- .../java/org/apache/commons/compress/archivers/zip/ZipFileTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java index 541f51da9..c2501d15d 100644 --- a/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java +++ b/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java @@ -964,7 +964,6 @@ public class ZipFileTest extends AbstractTest { @Test public void testZipWithShortBeginningGarbage() throws IOException { final Path path = createTempPath("preamble", ".zip"); - try (OutputStream fos = Files.newOutputStream(path)) { fos.write("#!/usr/bin/unzip\n".getBytes(StandardCharsets.UTF_8)); try (ZipArchiveOutputStream zos = new ZipArchiveOutputStream(fos)) { @@ -981,7 +980,8 @@ public class ZipFileTest extends AbstractTest { try (InputStream inputStream = zipFile.getInputStream(entry)) { final byte[] content = IOUtils.toByteArray(inputStream); assertArrayEquals("entry-content\n".getBytes(StandardCharsets.UTF_8), content); - }} + } + } }