changeset 52879:50a00bc8a0e2

8214498: java/util/Locale/bcp47u/SystemPropertyTests.java wrong locale default Reviewed-by: lancea, bpb
author rriggs
date Thu, 06 Dec 2018 09:55:02 -0500
parents e6f52c533cbc
children c56c30f9f991
files src/java.base/share/classes/jdk/internal/util/SystemProps.java
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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