mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-09 14:38:42 +00:00
8042360: Subtag syntax check is incomplete in Locale.LanguageRange
Reviewed-by: naoto, okutsu
This commit is contained in:
parent
b89a5598d4
commit
b597db519c
@ -2904,8 +2904,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) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user