On Mon, 28 Jul 2025 09:16:15 GMT, Alan Bateman <al...@openjdk.org> wrote:

> I think we should mull over the addition of CharSequence::codePointCount. On 
> the surface it looks like it fits but we can't rush it (CharSequence is 
> widely implemented and additions to this interface have a history of 
> disruption in the eco system).

We might as well defer it until another JBS issue if it is too difficult to 
decide whether it should be included in this PR.

> What is the reason for proposing Character.codePointCount(CharSequence) 
> aswell?

1. It already has an overload with the start and end indices unlike 
`CharSequence` like `String` and `AbstractStringBuilder`
2. Less harmful than `CharSequence::codePointCount` because it is just a static 
method.
3. There are already the `(CharSequence, int, int)` and `(char[], int, int)` 
overloads and the `(char[], int, int)` overload is used for the test for 
`String::codePointCount(int, int)`. We should add the `(char[])` overload for 
test and also add the `(CharSequence)` for consistency.

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

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

Reply via email to