RFR: 8302590: Add String.indexOf(int ch, int fromIndex, int toIndex) [v2]

Raffaello Giulietti rgiulietti at openjdk.org
Mon Feb 27 13:41:44 UTC 2023


On Mon, 27 Feb 2023 12:40:34 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> @AlanBateman I can propose variants of forward-searching _some-prefix_`IndexOf()` which are consistent with `substring()` in their handling of the indices, but I'd then rather prefer to file another JBS issue and prepare another PR.
>> 
>> The proposed 3 parameters variant of `indexOf()` _is_ the real "primitive" of the family. The other ones are mere shortcuts.
>
> Parking this PR while exploration is done into other options is okay.

@AlanBateman Both from an `@apiNote` and from an implementation perspective, the checked _some-prefix_`IndexOf()`variants would better make use of the public 3 params `indexOf()` API point proposed here, rather than relying on `StringLatin1` and `StringUTF16` internals.

Thus, parking this PR would mean that the other PR could not refer to the API point from here until this one is integrated. 

Perhaps I'm missing something.
Is it perhaps better to add the checked variants directly in this PR?

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

PR: https://git.openjdk.org/jdk/pull/12600


More information about the core-libs-dev mailing list