Skip to content

Commit 21a3b85

Browse files
committed
Fix unnecessary stream opening in BootZipCopyAction
Signed-off-by: namest504 <namest504@gmail.com>
1 parent 8a03a82 commit 21a3b85

File tree

1 file changed

+1
-3
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling

1 file changed

+1
-3
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootZipCopyAction.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,7 @@ private void writeJarToolsIfNecessary() throws IOException {
349349
private void writeJarModeLibrary(String location, JarModeLibrary library) throws IOException {
350350
String name = location + library.getName();
351351
writeEntry(name, ZipEntryContentWriter.fromInputStream(library.openStream()), false, (entry) -> {
352-
try (InputStream in = library.openStream()) {
353-
prepareStoredEntry(library.openStream(), false, entry);
354-
}
352+
prepareStoredEntry(library.openStream(), false, entry);
355353
});
356354
if (BootZipCopyAction.this.layerResolver != null) {
357355
Layer layer = BootZipCopyAction.this.layerResolver.getLayer(library);

0 commit comments

Comments
 (0)