RFR: 8259911: byteArrayViewVarHandle should throw ArrayIndexOutOfBoundsException

Claes Redestad redestad at openjdk.java.net
Mon Jan 18 12:16:00 UTC 2021


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)

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

Commit messages:
 - byteArrayViewVarHandle should throw ArrayIndexOutOfBoundsException

Changes: https://git.openjdk.java.net/jdk/pull/2124/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2124&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8259911
  Stats: 8 lines in 2 files changed: 5 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2124.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2124/head:pull/2124

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


More information about the hotspot-compiler-dev mailing list