< prev index next >

src/java.base/share/classes/jdk/internal/util/SystemProps.java

Print this page
rev 52825 : 8214498: java/util/Locale/bcp47u/SystemPropertyTests.java wrong locale default

*** 151,178 **** */ private static void fillI18nProps(Properties cmdProps, String base, String display, String format) { // Do not override command line setting String baseValue = cmdProps.getProperty(base); ! if (baseValue == null) { // Not overridden on the command line; define the properties if there are platform defined values baseValue = display; } - if (baseValue != null) { - cmdProps.put(base, baseValue); - } /* user.xxx.display property */ ! String disp = base + ".display"; String dispValue = cmdProps.getProperty(disp); if (dispValue == null && display != null && !display.equals(baseValue)) { // Create the property only if different from the base property cmdProps.put(disp, display); } /* user.xxx.format property */ ! String fmt = base + ".format"; String fmtValue = cmdProps.getProperty(fmt); if (fmtValue == null && format != null && !format.equals(baseValue)) { // Create the property only if different than the base property cmdProps.put(fmt, format); } --- 151,180 ---- */ private static void fillI18nProps(Properties cmdProps, String base, String display, String format) { // Do not override command line setting String baseValue = cmdProps.getProperty(base); ! if (baseValue != null) { ! return; // Do not override value from the command line ! } ! // Not overridden on the command line; define the properties if there are platform defined values + if (display != null) { + cmdProps.put(base, display); baseValue = display; } /* user.xxx.display property */ ! String disp = base.concat(".display"); String dispValue = cmdProps.getProperty(disp); if (dispValue == null && display != null && !display.equals(baseValue)) { // Create the property only if different from the base property cmdProps.put(disp, display); } /* user.xxx.format property */ ! String fmt = base.concat(".format"); String fmtValue = cmdProps.getProperty(fmt); if (fmtValue == null && format != null && !format.equals(baseValue)) { // Create the property only if different than the base property cmdProps.put(fmt, format); }
< prev index next >