RFR: JDK-8032012, , String.toLowerCase/toUpperCase performance improvement
Paul Sandoz
paul.sandoz at oracle.com
Thu Feb 6 09:44:07 UTC 2014
On Feb 6, 2014, at 5:37 AM, Xueming Shen <xueming.shen at oracle.com> wrote:
> Fair enough. I don't think it's going to be a measurable difference. I have updated the webrev
> to use the Character.isSurrogate() for better readability.
>
> http://cr.openjdk.java.net/~sherman/8032012/webrev
>
One last point, sorry :-)
Can you use Character.toUpperCase rather than Character.toUpperCaseEx ? [*].
Paul.
[*] They both seem to point to the same code, so either Character.toUpperCase can incorrectly return Character.ERROR or Character.toUpperCaseEx never returns ERROR:
public static int toUpperCase(int codePoint) {
return CharacterData.of(codePoint).toUpperCase(codePoint);
}
static int toUpperCaseEx(int codePoint) {
assert isValidCodePoint(codePoint);
return CharacterData.of(codePoint).toUpperCaseEx(codePoint);
}
abstract class CharacterData {
...
abstract int toUpperCase(int ch);
...
//need to implement for JSR204
int toUpperCaseEx(int ch) {
return toUpperCase(ch);
}
More information about the core-libs-dev
mailing list