RFR: 8268698: Use Objects.check{Index, FromToIndex, FromIndexSize} where possible [v6]

Joe Darcy joe.darcy at oracle.com
Fri Jun 25 19:57:43 UTC 2021


On 6/21/2021 2:02 PM, Paul Sandoz wrote:
> On Mon, 21 Jun 2021 05:17:09 GMT, Yi Yang <yyang at openjdk.org> wrote:
>
>>> After JDK-8265518(#3615), it's possible to replace all variants of checkIndex by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in the whole JDK codebase.
>> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
>>
>>    more replacement 2
> All the updates to the check* methods look ok (requires some careful looking!).
>
> I cannot recall what others said about the change in exception messages. @jddarcy any advice here?

Generally, the JDK does not have the text of exception message as a 
supported interface meant to be relied on by users. This doesn't stop 
developers from occasionally parsing those messages, but that is usually 
a sign of a missing API which we try to rectify more directly.

HTH,

-Joe



More information about the serviceability-dev mailing list