<i18n dev> RFR: 8365675: Add String Unicode Case-Folding Support [v4]

Xueming Shen sherman at openjdk.org
Mon Oct 27 09:30:05 UTC 2025


On Thu, 23 Oct 2025 17:47:51 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Xueming Shen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   test case update
>
> src/java.base/share/classes/java/lang/StringUTF16.java line 605:
> 
>> 603:         int k1 = off, k2 = ooff, fk1 = 0, fk2 = 0;
>> 604:         while ((k1 < last || folded1 != null && fk1 < folded1.length) &&
>> 605:                (k2 < olast || folded2 != null && fk2 < folded2.length)) {
> 
> Use ArraySupport.mismatch to quickly scan past identical sequences.  (byte index will need to be converted to char index).

seems like we are only using it for case-aware comparison in existing string comparison. just wonder do we really want to apply this for the case insensitive comparision?

    static int compareTo(byte[] value, byte[] other, int len1, int len2) {
        int lim = Math.min(len1, len2);
        int k = ArraysSupport.mismatch(value, other, lim);
        return (k < 0) ? len1 - len2 : getChar(value, k) - getChar(other, k);
    }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2464954933


More information about the i18n-dev mailing list