]> granicus.if.org Git - icu/commitdiff
ICU-8951 Feedback from Markus's review - fixed regex pattern for legacy key, and...
authorYoshito Umaoka <y.umaoka@gmail.com>
Wed, 10 Sep 2014 18:33:12 +0000 (18:33 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Wed, 10 Sep 2014 18:33:12 +0000 (18:33 +0000)
X-SVN-Rev: 36435

icu4j/main/classes/core/src/com/ibm/icu/util/ULocale.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java

index 987e670c84fea24566743f76b9087ae313380d4b..84d0534bd4fdcde6b77c12c813c35a3d5e1ff8bc 100644 (file)
@@ -3361,7 +3361,7 @@ public final class ULocale implements Serializable, Comparable<ULocale> {
             //  keys are using ASCII alphabetic letters only. We won't add any new key
             //  that is not compatible with the BCP 47 syntax. Therefore, we assume
             //  a valid key consist from [0-9a-zA-Z], no symbols.
-            if (keyword.matches("[0-9a-zA-Z]*")) {
+            if (keyword.matches("[0-9a-zA-Z]+")) {
                 legacyKey = AsciiUtil.toLowerString(keyword);
             }
         }
index a99265015963222cdf1003e8ac67b6f61d7f3e26..343763ad16d79b8fb8051c443744a0c439654f31 100644 (file)
@@ -4563,7 +4563,7 @@ public class ULocaleTest extends TestFmwk {
                 {"variableTop",     "00A0",             "00a0"},        // valid codepoints type
                 {"variableTop",     "wxyz",             "wxyz"},        // invalid codepoints type - return as is for now
                 {"kr",              "space-punct",      "space-punct"}, // valid reordercode type
-                {"kr",              "digit-spacepunct", "digit-spacepunct"},    // invalid reordercode type, bad ok for legacy syntax
+                {"kr",              "digit-spacepunct", "digit-spacepunct"},    // invalid reordercode type, but ok for legacy syntax
         };
 
         for (String[] d : DATA) {