Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FISH-1192 Jakarta EE 9: Duplicate entry ZipException is thrown on transforming web application servlet_plu_singlethreadmodel_web.war #9

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
* Copyright (c) 2020-2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -15,7 +15,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
Expand Down Expand Up @@ -177,13 +179,20 @@ protected void apply(String inputPath, ZipInputStream zipInputStream, ZipOutputS

String prevName = null;
String inputName = null;

Set<String> processedFile = new HashSet<>();

try {
byte[] buffer = new byte[FileUtils.BUFFER_ADJUSTMENT];

ZipEntry inputEntry;
while ((inputEntry = zipInputStream.getNextEntry()) != null) {
inputName = inputEntry.getName();
if(processedFile.contains(inputName)) {
continue;
} else {
processedFile.add(inputName);
}
long inputLength = inputEntry.getSize();

debug("[ {}.{} ] [ {} ] Size [ {} ]", getClass().getSimpleName(), "apply", inputName, inputLength);
Expand Down