mirror of
https://github.com/corda/corda.git
synced 2025-04-08 20:04:51 +00:00
implement toLowerCase(Locale) in the default case
This commit is contained in:
parent
250a77dc13
commit
fc2c6d5100
@ -236,19 +236,31 @@ public final class String
|
||||
}
|
||||
|
||||
public String toLowerCase() {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toLowerCase(charAt(i));
|
||||
for (int j = 0; j < length; ++j) {
|
||||
char ch = charAt(j);
|
||||
if (Character.toLowerCase(ch) != ch) {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toLowerCase(charAt(i));
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
}
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toUpperCase() {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toUpperCase(charAt(i));
|
||||
for (int j = 0; j < length; ++j) {
|
||||
char ch = charAt(j);
|
||||
if (Character.toUpperCase(ch) != ch) {
|
||||
char[] b = new char[length];
|
||||
for (int i = 0; i < length; ++i) {
|
||||
b[i] = Character.toUpperCase(charAt(i));
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
}
|
||||
}
|
||||
return new String(b, 0, length, false);
|
||||
return this;
|
||||
}
|
||||
|
||||
public int indexOf(int c) {
|
||||
@ -581,11 +593,19 @@ public final class String
|
||||
}
|
||||
|
||||
public String toUpperCase(Locale locale) {
|
||||
throw new UnsupportedOperationException();
|
||||
if (locale == Locale.ENGLISH) {
|
||||
return toUpperCase();
|
||||
} else {
|
||||
throw new UnsupportedOperationException("toUpperCase("+locale+')');
|
||||
}
|
||||
}
|
||||
|
||||
public String toLowerCase(Locale locale) {
|
||||
throw new UnsupportedOperationException();
|
||||
if (locale == Locale.ENGLISH) {
|
||||
return toLowerCase();
|
||||
} else {
|
||||
throw new UnsupportedOperationException("toLowerCase("+locale+')');
|
||||
}
|
||||
}
|
||||
|
||||
public static String format(Locale locale, String format, Object ... args) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user