< 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,28 +151,30 @@
*/
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) {
+ 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;
}
- if (baseValue != null) {
- cmdProps.put(base, baseValue);
- }
/* user.xxx.display property */
- String disp = base + ".display";
+ 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 + ".format";
+ 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 >