ICU-8951 Feedback from Markus's review - fixed regex pattern for legacy key, and one typo in comment.

X-SVN-Rev: 36435
This commit is contained in:
Yoshito Umaoka 2014-09-10 18:33:12 +00:00
parent 2411d1606b
commit 509d9757b0
2 changed files with 2 additions and 2 deletions

View 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);
}
}

View 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) {