-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 8, 11, 17, 23, 24, 25
-
Component/s: core-libs
-
b11
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Passing the invalid string "-" to Locale.LanguageRange.parse results in an ArrayIndexOutOfBoundsException being thrown instead of the expected IllegalArgumentException.
Method documentation says:
throws IllegalArgumentException - if a language range or a weight found in the given ranges is ill-formed
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
java.util.Locale.LanguageRange.parse("-");
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
IllegalArgumentException thrown
ACTUAL -
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args) {
java.util.Locale.LanguageRange.parse("-");
}
}
---------- END SOURCE ----------
Passing the invalid string "-" to Locale.LanguageRange.parse results in an ArrayIndexOutOfBoundsException being thrown instead of the expected IllegalArgumentException.
Method documentation says:
throws IllegalArgumentException - if a language range or a weight found in the given ranges is ill-formed
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
java.util.Locale.LanguageRange.parse("-");
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
IllegalArgumentException thrown
ACTUAL -
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args) {
java.util.Locale.LanguageRange.parse("-");
}
}
---------- END SOURCE ----------
- links to
-
Commit(master)
openjdk/jdk/3741c980
-
Review(master)
openjdk/jdk/23596