On Tue, 27 Jan 2026 11:33:21 GMT, Tatsunori Uchino <[email protected]> wrote:
>> Adds `codePointCount()` overloads to `String`, `Character`,
>> `(Abstract)StringBuilder`, and `StringBuffer` to make it possible to
>> conveniently retrieve the length of a string as code points without extra
>> boundary checks.
>>
>>
>> if (superTremendouslyLongExpressionYieldingAString().codePointCount() >
>> limit) {
>> throw new Exception("exceeding length");
>> }
>>
>>
>> Is a CSR required to this change?
>
> Tatsunori Uchino has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Replace "unpaired surrogates" with "isolated surrogate code units"
>
> https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G1654
> https://www.unicode.org/charts/PDF/UDC00.pdf
I think we can remove `Character.codePointCount(char[])`: users can use
`CharBuffer.wrap(char[]).codePointCount()` instead.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26461#issuecomment-3813712436