Skip to content

Commit 7e0a913

Browse files
committed
Merge pull request #47902 from namest504
* pr/47902: Remove unnecessary stream opening in BootZipCopyAction Closes gh-47902
2 parents 0891ec8 + de7cad3 commit 7e0a913

File tree

1 file changed

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

1 file changed

+2
-5
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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,8 @@ private void writeJarToolsIfNecessary() throws IOException {
348348

349349
private void writeJarModeLibrary(String location, JarModeLibrary library) throws IOException {
350350
String name = location + library.getName();
351-
writeEntry(name, ZipEntryContentWriter.fromInputStream(library.openStream()), false, (entry) -> {
352-
try (InputStream in = library.openStream()) {
353-
prepareStoredEntry(library.openStream(), false, entry);
354-
}
355-
});
351+
writeEntry(name, ZipEntryContentWriter.fromInputStream(library.openStream()), false,
352+
(entry) -> prepareStoredEntry(library.openStream(), false, entry));
356353
if (BootZipCopyAction.this.layerResolver != null) {
357354
Layer layer = BootZipCopyAction.this.layerResolver.getLayer(library);
358355
this.layerIndex.add(layer, name);

0 commit comments

Comments
 (0)