Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible NullPointerException from getPermission()
Fix regression in `JarUrlConnection` where a NullPointerException could be thrown internally causing performance issues. When the SecurityManager is present, the following stack trace is thrown: java.lang.NullPointerException: Cannot invoke "java.net.URLConnection.getPermission()" because "this.jarFileConnection" is null at org.springframework.boot.loader.net.protocol.jar.JarUrlConnection.getPermission(JarUrlConnection.java:175) at java.base/jdk.internal.loader.URLClassPath.check(URLClassPath.java:553) at java.base/jdk.internal.loader.URLClassPath$Loader.findResource(URLClassPath.java:612) at java.base/jdk.internal.loader.URLClassPath.findResource(URLClassPath.java:296) at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:629) at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:627) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.net.URLClassLoader.findResource(URLClassLoader.java:626) at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.findResource(JarUrlClassLoader.java:70) at java.base/java.lang.ClassLoader.getResource(ClassLoader.java:1403) at java.base/java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:290) at java.base/java.lang.Class.getResourceAsStream(Class.java:2850) See spring-projectsgh-39856
- Loading branch information