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

David Holmes dholmes at openjdk.java.net
Thu Jun 17 01:54:09 UTC 2021


On Wed, 16 Jun 2021 08:08:47 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.

I skimmed through all these and the changes seem fine in principal.
I have two mild concerns:

1. How does this change the class initialization order on VM startup?
2. Do any tests need adjusting due to potential changes in the exact message used by the IndexOutOfBoundsException?

Thanks,
David

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

PR: https://git.openjdk.java.net/jdk/pull/4507



More information about the security-dev mailing list