RFR: 8364007: Add no-argument codePointCount method to CharSequence and String [v9]

Tatsunori Uchino duke at openjdk.org
Wed Jan 28 23:28:38 UTC 2026


On Wed, 28 Jan 2026 23:25:30 GMT, Tatsunori Uchino <duke at openjdk.org> 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 refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   Remove `Character.codePointCount()`

I eliminated the _latest_ commit that has only change like trash. Sorry for the force-push.

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

PR Comment: https://git.openjdk.org/jdk/pull/26461#issuecomment-3814452281


More information about the core-libs-dev mailing list