You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/12/11 22:46:28 UTC
(commons-compress) branch master updated (ae5845166 -> cc5ad1625)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
from ae5845166 Use IOUtils.close(...)
new 4a6079b34 Use IOUtils.close(...)
new cc5ad1625 Use IOUtils.close(...)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/commons/compress/archivers/tar/TarFile.java | 7 ++-----
.../java/org/apache/commons/compress/archivers/zip/ZipFile.java | 6 +-----
2 files changed, 3 insertions(+), 10 deletions(-)
(commons-compress) 02/02: Use IOUtils.close(...)
Posted by gg...@apache.org.
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 <ga...@gmail.com>
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;
}
}
(commons-compress) 01/02: Use IOUtils.close(...)
Posted by gg...@apache.org.
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 4a6079b34d57513ef3d38098e134396c45ded2e8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 11 17:45:39 2025 -0500
Use IOUtils.close(...)
---
.../java/org/apache/commons/compress/archivers/tar/TarFile.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarFile.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarFile.java
index 0612626ed..c1dc46bc2 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarFile.java
@@ -42,6 +42,7 @@
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.compress.utils.ArchiveUtils;
import org.apache.commons.compress.utils.BoundedArchiveInputStream;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.io.function.IOStream;
import org.apache.commons.io.input.BoundedInputStream;
@@ -192,11 +193,7 @@ private TarFile(final Builder builder) throws IOException {
entries.add(entry);
}
} catch (final IOException ex) {
- try {
- this.archive.close();
- } catch (final IOException e) {
- ex.addSuppressed(e);
- }
+ IOUtils.close(archive, ex::addSuppressed);
throw ex;
}
}