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 62ff1dcfd Remove unused local variable in ZipFile (#615) 62ff1dcfd is described below commit 62ff1dcfd7c94aed110894805cb95dfe52cbd516 Author: Glavo <zjx001...@gmail.com> AuthorDate: Tue Nov 26 20:28:22 2024 +0800 Remove unused local variable in ZipFile (#615) * Remove unused local variable in ZipFile * delete unused import --- src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java | 3 --- 1 file changed, 3 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 5f3054ed9..d167e2f4b 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 @@ -34,7 +34,6 @@ import java.nio.file.Files; import java.nio.file.OpenOption; import java.nio.file.Path; import java.nio.file.StandardOpenOption; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; @@ -499,7 +498,6 @@ public class ZipFile implements Closeable { private static SeekableByteChannel openZipChannel(final Path path, final long maxNumberOfDisks, final OpenOption[] openOptions) throws IOException { final FileChannel channel = FileChannel.open(path, StandardOpenOption.READ); - final List<FileChannel> channels = new ArrayList<>(); try { final boolean is64 = positionAtEndOfCentralDirectoryRecord(channel); long numberOfDisks; @@ -546,7 +544,6 @@ public class ZipFile implements Closeable { }).collect(Collectors.toList()), openOptions); } catch (final Throwable ex) { org.apache.commons.io.IOUtils.closeQuietly(channel); - channels.forEach(org.apache.commons.io.IOUtils::closeQuietly); throw ex; } }