Merge pull request #47902 from namest504

* pr/47902:
  Remove unnecessary stream opening in BootZipCopyAction

Closes gh-47902
This commit is contained in:
Stéphane Nicoll
2025-11-03 10:23:20 +01:00
@@ -348,11 +348,8 @@ class BootZipCopyAction implements CopyAction {
private void writeJarModeLibrary(String location, JarModeLibrary library) throws IOException {
String name = location + library.getName();
writeEntry(name, ZipEntryContentWriter.fromInputStream(library.openStream()), false, (entry) -> {
try (InputStream in = library.openStream()) {
prepareStoredEntry(library.openStream(), false, entry);
}
});
writeEntry(name, ZipEntryContentWriter.fromInputStream(library.openStream()), false,
(entry) -> prepareStoredEntry(library.openStream(), false, entry));
if (BootZipCopyAction.this.layerResolver != null) {
Layer layer = BootZipCopyAction.this.layerResolver.getLayer(library);
this.layerIndex.add(layer, name);