RFR: 8364007: Add no-argument codePointCount method to CharSequence and String [v4]
Tatsunori Uchino
duke at openjdk.org
Tue Jan 27 03:43:39 UTC 2026
On Mon, 26 Jan 2026 23:55:12 GMT, Tatsunori Uchino <duke at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/Character.java line 10004:
>>
>>> 10002: /**
>>> 10003: * {@return the number of Unicode code points in the {@code char} array}
>>> 10004: * Unpaired surrogates count as one code point each.
>>
>> It'd be better to replace "surrogates" with "surrogate code units." Applies to other method descriptions too.
>
> Agree. I have personally disliked the expression "surrogate" for such code units. We will need another tickets for JavaDoc for the other methods that are not concerned with this ticket.
[Unicode seems to treat "_isolated_ surrogate code unit" as a first-class citizen.](https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G1654)
https://www.unicode.org/charts/PDF/UDC00.pdf
https://www.google.com/search?q=site:unicode.org+%22isolated+surrogate+code%22
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26461#discussion_r2730108791
More information about the core-libs-dev
mailing list