You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't close nested jars or wrapper when parent is closed
Update `JarFile` so that the `close()` method no longer closes nested
jars or the wrapper. Prior to this commit it was possible for a parent
jar file to be garbage collected and closed even though references still
existed to the nested jars. When this happened the nested jars would get
closed and any access to entries would result in `JarFile.ensureOpen()`
throwing an `IllegalStateException`. The user would often not see this
exception directly, but rather find `ClassNotFoundException` being
thrown.
Fixesgh-31853
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java
+1-14Lines changed: 1 addition & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -26,11 +26,8 @@
26
26
importjava.net.URLStreamHandler;
27
27
importjava.net.URLStreamHandlerFactory;
28
28
importjava.security.Permission;
29
-
importjava.util.ArrayList;
30
-
importjava.util.Collections;
31
29
importjava.util.Enumeration;
32
30
importjava.util.Iterator;
33
-
importjava.util.List;
34
31
importjava.util.Spliterator;
35
32
importjava.util.Spliterators;
36
33
importjava.util.function.Supplier;
@@ -96,8 +93,6 @@ public class JarFile extends AbstractJarFile implements Iterable<java.util.jar.J
0 commit comments