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 cc5ad162526e87cdbaf66785774b5436d2a1a696 Author: Gary Gregory <[email protected]> AuthorDate: Thu Dec 11 17:45:45 2025 -0500 Use IOUtils.close(...) --- .../java/org/apache/commons/compress/archivers/zip/ZipFile.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java index e0cd181e8..07f91acf0 100644 --- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java +++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java @@ -760,11 +760,7 @@ private ZipFile(final Builder builder) throws IOException { ? (ArchiveException) e : new ArchiveException("Error reading Zip content from " + builder.getName(), (Throwable) e); this.closed = true; - try { - this.archive.close(); - } catch (final IOException ioException) { - archiveException.addSuppressed(ioException); - } + IOUtils.close(archive, archiveException::addSuppressed); throw archiveException; } }
