RFR: 8259911: byteArrayViewVarHandle should throw ArrayIndexOutOfBoundsException

Mandy Chung mchung at openjdk.java.net
Tue Jan 19 19:45:55 UTC 2021

On Mon, 18 Jan 2021 12:09:23 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Change `MethodHandles.byteArrayViewVarHandle` to throw `ArrayIndexOutOfBoundsException` rather than the more generic `IndexArrayOutOfBoundsException`. This feels more natural, and reduces the risk for subtle behavioral mismatch when migrating code from arrays/Unsafe to VHs. 
> CSR: [JDK-8259912](https://bugs.openjdk.java.net/browse/JDK-8259912)

The change to AIOOBE is reasonable.    Have you considered making this just as an implementation change and leave the spec as is?


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

More information about the core-libs-dev mailing list