From 7d53f7d27fb6ed2b606ca55f33616e681b09b7fe Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Sat, 25 Apr 2020 22:19:42 -0700 Subject: [PATCH] Attempt to prevent JarFiles from being left open Update `JarFile` to also call `super.close()` early for nested jars. See gh-21126 --- .../main/java/org/springframework/boot/loader/jar/JarFile.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java index f73e2f1cd02..c12e3cc2e56 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java @@ -111,6 +111,7 @@ public class JarFile extends java.util.jar.JarFile { */ JarFile(JarFile parent) throws IOException { super(parent.rootFile.getFile()); + super.close(); this.parent = parent; this.rootFile = parent.rootFile; this.pathFromRoot = parent.pathFromRoot;