8175079: Lazy initialization of ImageReader breaks rmid
authorredestad
Thu, 16 Feb 2017 17:28:50 +0100
changeset 43813 ab5cb6ace73b
parent 43812 a6e3407e9f32
child 43814 c175b059160b
child 43996 dc4eedadae1e
8175079: Lazy initialization of ImageReader breaks rmid Reviewed-by: alanb
jdk/src/java.base/share/classes/java/lang/System.java
jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
--- a/jdk/src/java.base/share/classes/java/lang/System.java	Thu Feb 16 11:26:14 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/System.java	Thu Feb 16 17:28:50 2017 +0100
@@ -1945,9 +1945,6 @@
         // set security manager
         String cn = System.getProperty("java.security.manager");
         if (cn != null) {
-            // ensure image reader for java.base is initialized before security manager
-            Object.class.getResource("module-info.class");
-
             if (cn.isEmpty() || "default".equals(cn)) {
                 System.setSecurityManager(new SecurityManager());
             } else {
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java	Thu Feb 16 11:26:14 2017 +0000
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java	Thu Feb 16 17:28:50 2017 +0100
@@ -115,12 +115,7 @@
         long t0 = System.nanoTime();
 
         // system modules (may be patched)
-        ModuleFinder systemModules;
-        if (SystemModules.MODULE_NAMES.length > 0) {
-            systemModules = SystemModuleFinder.getInstance();
-        } else {
-            systemModules = ModuleFinder.ofSystem();
-        }
+        ModuleFinder systemModules = ModuleFinder.ofSystem();
 
         PerfCounters.systemModulesTime.addElapsedTimeFrom(t0);