8229283: StringLatin1 should consistently use CharacterDataLatin1.instance when applicable
Reviewed-by: jlaskey
This commit is contained in:
parent
28737bd07f
commit
46e4b55e23
@ -177,7 +177,7 @@ final class StringLatin1 {
|
||||
char c1 = getChar(value, k);
|
||||
char c2 = StringUTF16.getChar(other, k);
|
||||
if (c1 != c2) {
|
||||
c1 = Character.toUpperCase(c1);
|
||||
c1 = (char) CharacterDataLatin1.instance.toUpperCase(c1);
|
||||
c2 = Character.toUpperCase(c2);
|
||||
if (c1 != c2) {
|
||||
c1 = Character.toLowerCase(c1);
|
||||
@ -391,8 +391,8 @@ final class StringLatin1 {
|
||||
if (c1 == c2) {
|
||||
continue;
|
||||
}
|
||||
char u1 = Character.toUpperCase(c1);
|
||||
char u2 = Character.toUpperCase(c2);
|
||||
int u1 = CharacterDataLatin1.instance.toUpperCase(c1);
|
||||
int u2 = CharacterDataLatin1.instance.toUpperCase(c2);
|
||||
if (u1 == u2) {
|
||||
continue;
|
||||
}
|
||||
@ -413,7 +413,7 @@ final class StringLatin1 {
|
||||
if (c1 == c2) {
|
||||
continue;
|
||||
}
|
||||
char u1 = Character.toUpperCase(c1);
|
||||
char u1 = (char) CharacterDataLatin1.instance.toUpperCase(c1);
|
||||
char u2 = Character.toUpperCase(c2);
|
||||
if (u1 == u2) {
|
||||
continue;
|
||||
@ -435,7 +435,7 @@ final class StringLatin1 {
|
||||
// Now check if there are any characters that need to be changed, or are surrogate
|
||||
for (first = 0 ; first < len; first++) {
|
||||
int cp = value[first] & 0xff;
|
||||
if (cp != Character.toLowerCase(cp)) { // no need to check Character.ERROR
|
||||
if (cp != CharacterDataLatin1.instance.toLowerCase(cp)) { // no need to check Character.ERROR
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -450,7 +450,7 @@ final class StringLatin1 {
|
||||
// lowerCase characters.
|
||||
for (int i = first; i < len; i++) {
|
||||
int cp = value[i] & 0xff;
|
||||
cp = Character.toLowerCase(cp);
|
||||
cp = CharacterDataLatin1.instance.toLowerCase(cp);
|
||||
if (!canEncode(cp)) { // not a latin1 character
|
||||
return toLowerCaseEx(str, value, first, locale, false);
|
||||
}
|
||||
@ -474,7 +474,7 @@ final class StringLatin1 {
|
||||
if (localeDependent) {
|
||||
lowerChar = ConditionalSpecialCasing.toLowerCaseEx(str, i, locale);
|
||||
} else {
|
||||
lowerChar = Character.toLowerCase(srcChar);
|
||||
lowerChar = CharacterDataLatin1.instance.toLowerCase(srcChar);
|
||||
}
|
||||
if (Character.isBmpCodePoint(lowerChar)) { // Character.ERROR is not a bmp
|
||||
StringUTF16.putChar(result, resultOffset++, lowerChar);
|
||||
@ -509,7 +509,7 @@ final class StringLatin1 {
|
||||
// Now check if there are any characters that need to be changed, or are surrogate
|
||||
for (first = 0 ; first < len; first++ ) {
|
||||
int cp = value[first] & 0xff;
|
||||
if (cp != Character.toUpperCaseEx(cp)) { // no need to check Character.ERROR
|
||||
if (cp != CharacterDataLatin1.instance.toUpperCaseEx(cp)) { // no need to check Character.ERROR
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -525,7 +525,7 @@ final class StringLatin1 {
|
||||
// upperCase characters.
|
||||
for (int i = first; i < len; i++) {
|
||||
int cp = value[i] & 0xff;
|
||||
cp = Character.toUpperCaseEx(cp);
|
||||
cp = CharacterDataLatin1.instance.toUpperCaseEx(cp);
|
||||
if (!canEncode(cp)) { // not a latin1 character
|
||||
return toUpperCaseEx(str, value, first, locale, false);
|
||||
}
|
||||
@ -549,7 +549,7 @@ final class StringLatin1 {
|
||||
if (localeDependent) {
|
||||
upperChar = ConditionalSpecialCasing.toUpperCaseEx(str, i, locale);
|
||||
} else {
|
||||
upperChar = Character.toUpperCaseEx(srcChar);
|
||||
upperChar = CharacterDataLatin1.instance.toUpperCaseEx(srcChar);
|
||||
}
|
||||
if (Character.isBmpCodePoint(upperChar)) {
|
||||
StringUTF16.putChar(result, resultOffset++, upperChar);
|
||||
@ -559,7 +559,7 @@ final class StringLatin1 {
|
||||
upperCharArray =
|
||||
ConditionalSpecialCasing.toUpperCaseCharArray(str, i, locale);
|
||||
} else {
|
||||
upperCharArray = Character.toUpperCaseCharArray(srcChar);
|
||||
upperCharArray = CharacterDataLatin1.instance.toUpperCaseCharArray(srcChar);
|
||||
}
|
||||
} else {
|
||||
upperCharArray = Character.toChars(upperChar);
|
||||
@ -597,7 +597,7 @@ final class StringLatin1 {
|
||||
int left = 0;
|
||||
while (left < length) {
|
||||
char ch = getChar(value, left);
|
||||
if (ch != ' ' && ch != '\t' && !Character.isWhitespace(ch)) {
|
||||
if (ch != ' ' && ch != '\t' && !CharacterDataLatin1.instance.isWhitespace(ch)) {
|
||||
break;
|
||||
}
|
||||
left++;
|
||||
@ -610,7 +610,7 @@ final class StringLatin1 {
|
||||
int right = length;
|
||||
while (0 < right) {
|
||||
char ch = getChar(value, right - 1);
|
||||
if (ch != ' ' && ch != '\t' && !Character.isWhitespace(ch)) {
|
||||
if (ch != ' ' && ch != '\t' && !CharacterDataLatin1.instance.isWhitespace(ch)) {
|
||||
break;
|
||||
}
|
||||
right--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user