Skip to content

Commit

Permalink
Drop usage of wrapForJDK8232879
Browse files Browse the repository at this point in the history
The `wrapForJDK8232879` method works around https://bugs.openjdk.org/browse/JDK-8232879 which has been solved since Java 14 in 2019. We no longer require it to be used.
  • Loading branch information
dmlloyd committed Mar 27, 2024
1 parent b087d1e commit e4e371d
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.quarkus.deployment.pkg.steps;

import static io.quarkus.deployment.pkg.PackageConfig.JarConfig.JarType.*;
import static io.quarkus.fs.util.ZipUtils.wrapForJDK8232879;

import java.io.BufferedInputStream;
import java.io.BufferedWriter;
Expand Down Expand Up @@ -1175,7 +1174,7 @@ private void copyCommonContent(FileSystem runnerZipFs, Map<String, List<byte[]>>
if (i.getData() != null) {
Path target = runnerZipFs.getPath(i.getFileName());
handleParent(runnerZipFs, i.getFileName(), seen);
try (final OutputStream out = wrapForJDK8232879(Files.newOutputStream(target))) {
try (final OutputStream out = Files.newOutputStream(target)) {
out.write(i.getData());
}
seen.put(i.getFileName(), "Current Application");
Expand All @@ -1190,7 +1189,7 @@ private void copyCommonContent(FileSystem runnerZipFs, Map<String, List<byte[]>>
if (Files.exists(target)) {
continue;
}
try (final OutputStream os = wrapForJDK8232879(Files.newOutputStream(target))) {
try (final OutputStream os = Files.newOutputStream(target)) {
os.write(i.getClassData());
}
}
Expand All @@ -1207,7 +1206,7 @@ private void copyCommonContent(FileSystem runnerZipFs, Map<String, List<byte[]>>
if (i.getName().startsWith("META-INF/services/")) {
concatenatedEntries.computeIfAbsent(i.getName(), (u) -> new ArrayList<>()).add(i.getData());
} else {
try (final OutputStream os = wrapForJDK8232879(Files.newOutputStream(target))) {
try (final OutputStream os = Files.newOutputStream(target)) {
os.write(i.getData());
}
}
Expand All @@ -1216,8 +1215,7 @@ private void copyCommonContent(FileSystem runnerZipFs, Map<String, List<byte[]>>
copyFiles(appArchives.getRootArchive(), runnerZipFs, concatenatedEntries, ignoredEntriesPredicate);

for (Map.Entry<String, List<byte[]>> entry : concatenatedEntries.entrySet()) {
try (final OutputStream os = wrapForJDK8232879(
Files.newOutputStream(runnerZipFs.getPath(entry.getKey())))) {
try (final OutputStream os = Files.newOutputStream(runnerZipFs.getPath(entry.getKey()))) {
// TODO: Handle merging of XMLs
for (byte[] i : entry.getValue()) {
os.write(i);
Expand Down Expand Up @@ -1331,7 +1329,7 @@ private void generateManifest(FileSystem runnerZipFs, final String classPath, Pa
attribs.putValue(entry.getKey(), entry.getValue());
}
}
try (final OutputStream os = wrapForJDK8232879(Files.newOutputStream(manifestPath))) {
try (final OutputStream os = Files.newOutputStream(manifestPath)) {
manifest.write(os);
}
}
Expand Down

0 comments on commit e4e371d

Please sign in to comment.