< prev index next >

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

Print this page
rev 52426 : 8185496: Improve performance of system properties initialization in initPhase1
8213424: VersionProps duplicate and skipped initialization

@@ -800,10 +800,11 @@
             sm.checkPropertiesAccess();
         }
         if (props == null) {
             props = new Properties();
             initProperties(props);
+            VersionProps.init(props);
         }
         System.props = props;
     }
 
     /**

@@ -1971,10 +1972,11 @@
         // initialization. So make sure the "props" is available at the
         // very beginning of the initialization and all system properties to
         // be put into it directly.
         props = new Properties(84);
         initProperties(props);  // initialized by the VM
+        VersionProps.init(props);
 
         // There are certain system configurations that may be controlled by
         // VM options such as the maximum amount of direct memory and
         // Integer cache size used to support the object identity semantics
         // of autoboxing.  Typically, the library will obtain these values

@@ -1990,11 +1992,10 @@
         // certain system properties that are not intended for public access.
         VM.saveAndRemoveProperties(props);
 
         lineSeparator = props.getProperty("line.separator");
         StaticProperty.javaHome();          // Load StaticProperty to cache the property values
-        VersionProps.init();
 
         FileInputStream fdIn = new FileInputStream(FileDescriptor.in);
         FileOutputStream fdOut = new FileOutputStream(FileDescriptor.out);
         FileOutputStream fdErr = new FileOutputStream(FileDescriptor.err);
         setIn0(new BufferedInputStream(fdIn));
< prev index next >