提交 b407173f 编写于 作者: P peytoia

8042360: Subtag syntax check is incomplete in Locale.LanguageRange

Reviewed-by: naoto, okutsu
上级 77d81452
......@@ -2905,8 +2905,8 @@ public final class Locale implements Cloneable, Serializable {
for (int i = 1; i < subtags.length; i++) {
if (isSubtagIllFormed(subtags[i], false)) {
isIllFormed = true;
break;
}
break;
}
}
if (isIllFormed) {
......
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -23,7 +23,7 @@
/*
* @test
* @bug 7069824
* @bug 7069824 8042360
* @summary Verify implementation for Locale matching.
* @run main Bug7069824
*/
......@@ -91,6 +91,17 @@ public class Bug7069824 {
String range;
double weight;
// Testcase for 8042360
range = "en-Latn-1234567890";
try {
lr = new LanguageRange(range);
error = true;
System.err.println(" IAE should be thrown for LanguageRange("
+ range + ").");
}
catch (IllegalArgumentException ex) {
}
range = null;
try {
lr = new LanguageRange(range);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册