< prev index next >

src/java.base/share/classes/java/lang/VersionProps.java.template

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

*** 27,36 **** --- 27,37 ---- import java.io.PrintStream; import java.util.Arrays; import java.util.List; import java.util.Optional; + import java.util.Properties; class VersionProps { private static final String launcher_name = "@@LAUNCHER_NAME@@";
*** 67,87 **** private static final String vendor_version = (VENDOR_VERSION_STRING.length() > 0 ? " " + VENDOR_VERSION_STRING : ""); ! static { ! init(); ! } ! ! public static void init() { ! System.setProperty("java.version", java_version); ! System.setProperty("java.version.date", java_version_date); ! System.setProperty("java.runtime.version", java_runtime_version); ! System.setProperty("java.runtime.name", java_runtime_name); if (VENDOR_VERSION_STRING.length() > 0) ! System.setProperty("java.vendor.version", VENDOR_VERSION_STRING); } private static int parseVersionNumber(String version, int prevIndex, int index) { if (index - prevIndex > 1 && Character.digit(version.charAt(prevIndex), 10) <= 0) --- 68,84 ---- private static final String vendor_version = (VENDOR_VERSION_STRING.length() > 0 ? " " + VENDOR_VERSION_STRING : ""); ! public static void init(Properties props) { ! props.setProperty("java.version", java_version); ! props.setProperty("java.version.date", java_version_date); ! props.setProperty("java.runtime.version", java_runtime_version); ! props.setProperty("java.runtime.name", java_runtime_name); if (VENDOR_VERSION_STRING.length() > 0) ! props.setProperty("java.vendor.version", VENDOR_VERSION_STRING); } private static int parseVersionNumber(String version, int prevIndex, int index) { if (index - prevIndex > 1 && Character.digit(version.charAt(prevIndex), 10) <= 0)
< prev index next >