RFR: 8335638: Calling VarHandle.{access-mode} methods reflectively throws wrong exception

Hannes Greule hgreule at openjdk.org
Wed Jul 3 19:47:39 UTC 2024


Similar to how `MethodHandle#invoke(Exact)` methods are already handled, this change adds special casing for `VarHandle.{access-mode}` methods.

The exception message is less exact, but I think that's acceptable.

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

Commit messages:
 - add test (and find missing method)
 - make reflective calls to signature polymorphic methods in VarHandle throw UOE

Changes: https://git.openjdk.org/jdk/pull/20015/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20015&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8335638
  Stats: 75 lines in 2 files changed: 71 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/20015.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20015/head:pull/20015

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


More information about the core-libs-dev mailing list