8160312: ArrayIndexOutOfBoundsException when comparing strings case insensitive

Reviewed-by: rriggs
This commit is contained in:
Xueming Shen 2016-06-27 13:57:24 -07:00
parent 396d6f6285
commit 6223e843f9
2 changed files with 7 additions and 3 deletions

View file

@ -137,8 +137,8 @@ final class StringLatin1 {
char c1 = (char) CharacterDataLatin1.instance.toUpperCase(getChar(value, k));
char c2 = (char) CharacterDataLatin1.instance.toUpperCase(getChar(other, k));
if (c1 != c2) {
c1 = (char) CharacterDataLatin1.instance.toLowerCase(c1);
c2 = (char) CharacterDataLatin1.instance.toLowerCase(c2);
c1 = Character.toLowerCase(c1);
c2 = Character.toLowerCase(c2);
if (c1 != c2) {
return c1 - c2;
}