提交 330ece59 编写于 作者: N naoto

6986612: pit jdk7 b112: java.util.Locale getDisplayVariant() sqe test...

6986612: pit jdk7 b112: java.util.Locale getDisplayVariant() sqe test getDisplayVariantTests.java fails
Reviewed-by: dougfelt
Contributed-by: NYoshito Umaoka <y.umaoka@gmail.com>
上级 33d2decc
......@@ -569,6 +569,9 @@ public final class Locale implements Cloneable, Serializable {
* @exception NullPointerException thrown if any argument is null.
*/
public Locale(String language, String country, String variant) {
if (language== null || country == null || variant == null) {
throw new NullPointerException();
}
_baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), "", country, variant);
_extensions = getCompatibilityExtensions(language, "", country, variant);
}
......
......@@ -64,12 +64,14 @@ public final class BaseLocale {
public static BaseLocale getInstance(String language, String script, String region, String variant) {
// JDK uses deprecated ISO639.1 language codes for he, yi and id
if (AsciiUtil.caseIgnoreMatch(language, "he")) {
language = "iw";
} else if (AsciiUtil.caseIgnoreMatch(language, "yi")) {
language = "ji";
} else if (AsciiUtil.caseIgnoreMatch(language, "id")) {
language = "in";
if (language != null) {
if (AsciiUtil.caseIgnoreMatch(language, "he")) {
language = "iw";
} else if (AsciiUtil.caseIgnoreMatch(language, "yi")) {
language = "ji";
} else if (AsciiUtil.caseIgnoreMatch(language, "id")) {
language = "in";
}
}
Key key = new Key(language, script, region, variant);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册