8214498: java/util/Locale/bcp47u/SystemPropertyTests.java wrong locale default
authorrriggs
Thu, 06 Dec 2018 09:55:02 -0500
changeset 52879 50a00bc8a0e2
parent 52878 e6f52c533cbc
child 52880 c56c30f9f991
8214498: java/util/Locale/bcp47u/SystemPropertyTests.java wrong locale default Reviewed-by: lancea, bpb
src/java.base/share/classes/jdk/internal/util/SystemProps.java
--- a/src/java.base/share/classes/jdk/internal/util/SystemProps.java	Thu Dec 06 09:58:26 2018 -0500
+++ b/src/java.base/share/classes/jdk/internal/util/SystemProps.java	Thu Dec 06 09:55:02 2018 -0500
@@ -152,16 +152,18 @@
                                       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
+        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
@@ -169,7 +171,7 @@
         }
 
         /* 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