6997928: LocaleCategory test fails with b118 PIT
authornaoto
Fri, 05 Nov 2010 20:58:10 -0700
changeset 7049 f6ad89ce23f7
parent 7048 90f459535526
child 7050 525b0c46526a
6997928: LocaleCategory test fails with b118 PIT Reviewed-by: sherman
jdk/test/java/util/Locale/LocaleCategory.java
jdk/test/java/util/Locale/LocaleCategory.sh
--- a/jdk/test/java/util/Locale/LocaleCategory.java	Tue Nov 02 19:40:45 2010 -0700
+++ b/jdk/test/java/util/Locale/LocaleCategory.java	Fri Nov 05 20:58:10 2010 -0700
@@ -29,15 +29,28 @@
     private static String enc = null;
 
     public static void main(String[] args) {
-        base = new Locale(System.getProperty("user.language", ""),
-                          System.getProperty("user.country", ""),
-                          System.getProperty("user.variant", ""));
-        disp = new Locale(System.getProperty("user.language.display", ""),
-                          System.getProperty("user.country.display", ""),
-                          System.getProperty("user.variant.display", ""));
-        fmt  = new Locale(System.getProperty("user.language.format", ""),
-                          System.getProperty("user.country.format", ""),
-                          System.getProperty("user.variant.format", ""));
+        Locale.Builder builder = new Locale.Builder();
+
+        base = builder.setLanguage(System.getProperty("user.language", ""))
+                      .setScript(System.getProperty("user.script", ""))
+                      .setRegion(System.getProperty("user.country", ""))
+                      .setVariant(System.getProperty("user.variant", "")).build();
+        disp = builder.setLanguage(System.getProperty("user.language.display",
+                                                      Locale.getDefault().getLanguage()))
+                      .setScript(System.getProperty("user.script.display",
+                                                    Locale.getDefault().getScript()))
+                      .setRegion(System.getProperty("user.country.display",
+                                                    Locale.getDefault().getCountry()))
+                      .setVariant(System.getProperty("user.variant.display",
+                                                     Locale.getDefault().getVariant())).build();
+        fmt = builder.setLanguage(System.getProperty("user.language.format",
+                                                     Locale.getDefault().getLanguage()))
+                     .setScript(System.getProperty("user.script.format",
+                                                   Locale.getDefault().getScript()))
+                     .setRegion(System.getProperty("user.country.format",
+                                                   Locale.getDefault().getCountry()))
+                     .setVariant(System.getProperty("user.variant.format",
+                                                     Locale.getDefault().getVariant())).build();
         checkDefault();
         testGetSetDefault();
     }
--- a/jdk/test/java/util/Locale/LocaleCategory.sh	Tue Nov 02 19:40:45 2010 -0700
+++ b/jdk/test/java/util/Locale/LocaleCategory.sh	Fri Nov 05 20:58:10 2010 -0700
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # @test
-# @bug 4700857
+# @bug 4700857 6997928
 # @summary tests for Locale.getDefault(Locale.Category) and 
 #    Locale.setDefault(Locale.Category, Locale)
 # @build LocaleCategory