From de7cad3d63bf1205846c28614e1c1d93b5889440 Mon Sep 17 00:00:00 2001 From: namest504 Date: Sun, 2 Nov 2025 00:33:18 +0900 Subject: [PATCH] Remove unnecessary stream opening in BootZipCopyAction See gh-47902 Signed-off-by: namest504 --- .../boot/gradle/tasks/bundling/BootZipCopyAction.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java index 0eb16258fb7..7eeadbd84c8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java @@ -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);