< prev index next >

src/java.base/share/classes/java/lang/System.java

Print this page
rev 56007 : 8229773: Resolve permissions for code source URLs lazily
Reviewed-by: alanb, mullan, rriggs, dfuchs

@@ -72,10 +72,11 @@
 import jdk.internal.logger.LoggerFinderLoader;
 import jdk.internal.logger.LazyLoggers;
 import jdk.internal.logger.LocalizedLoggerWrapper;
 import jdk.internal.util.SystemProps;
 import jdk.internal.vm.annotation.Stable;
+import sun.nio.fs.DefaultFileSystemProvider;
 import sun.reflect.annotation.AnnotationType;
 import sun.nio.ch.Interruptible;
 import sun.security.util.SecurityConstants;
 
 /**

@@ -337,10 +338,12 @@
     public static void setSecurityManager(SecurityManager sm) {
         if (allowSecurityManager()) {
             if (security == null) {
                 // ensure image reader is initialized
                 Object.class.getResource("java/lang/ANY");
+                // ensure the default file system is initialized
+                DefaultFileSystemProvider.theFileSystem();
             }
             if (sm != null) {
                 try {
                     // pre-populates the SecurityManager.packageAccess cache
                     // to avoid recursive permission checking issues with custom
< prev index next >