test/java/util/Locale/LocaleProviders.java

Print this page
rev 7036 : imported patch 8013086

@@ -58,10 +58,14 @@
 
             case "bug8010666Test":
                 bug8010666Test();
                 break;
 
+            case "bug8013086Test":
+                bug8013086Test(args[1], args[2]);
+                break;
+
             default:
                 throw new RuntimeException("Test method '"+methodName+"' not found.");
         }
     }
 

@@ -140,6 +144,15 @@
             } catch (ParseException pe) {
                 throw new RuntimeException("Parsing Windows version failed: "+pe.toString());
             }
         }
     }
+
+    static void bug8013086Test(String lang, String ctry) {
+        try {
+            // Throws a NullPointerException if the test fails.
+            System.out.println(new SimpleDateFormat("z", new Locale(lang, ctry)).parse("UTC"));
+        } catch (ParseException pe) {
+            // ParseException is fine in this test, as it's not "UTC"
+        }
+    }
 }