RFR: 8311220: Optimization for StringLatin UpperLower [v3]

温绍锦 duke at openjdk.org
Fri Sep 1 20:08:40 UTC 2023


On Thu, 31 Aug 2023 11:45:31 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> I think this overall looks reasonable, but I think a more thorough proof / test would help to build confidence that all these changes are semantically neutral.
> 
> The `isLowerCaseEx` needs to explain why two lower-case codepoints are omitted (perhaps this should be `hasUpperCase`?)


String str1 = new String(new byte[]{(byte) 0xb5}, StandardCharsets.ISO_8859_1);
String str2 = new String(new byte[]{(byte) 0xdf}, StandardCharsets.ISO_8859_1);
System.out.println(str1 + "\t" + str1.toUpperCase());
System.out.println(str2 + "\t" + str2.toUpperCase());


result : 

µ	Μ
ß	SS


0xb5 and 0xdf call toUpperCaseEx return and input are different, these two codepoints are to ensure that the behavior has not changed.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14751#issuecomment-1703265488


More information about the core-libs-dev mailing list