RFR: 8356942: invokeinterface Throws AbstractMethodError Instead of IncompatibleClassChangeError

David Holmes dholmes at openjdk.org
Thu Jul 3 22:20:32 UTC 2025


In [JDK-8186092](https://bugs.openjdk.org/browse/JDK-8186092) (way back in JDK 10) we elided loader constraint checks for overpass methods related to default methods by skipping them when initializing the itable for the interface. But that was the wrong thing to do. The overpass method is setup when there is a resolution/selection error so that the correct exception is thrown if the problematic method is invoked (like the ICCE reporting conflicting methods) and by eliding that entry we instead get the `AbstractMethhodError`.

The fix here is to revert that change from [JDK-8186092](https://bugs.openjdk.org/browse/JDK-8186092), and to address the loader constraint problem by adding the same check for overpass methods in `klassItable::check_constraints` that exists for `klassVtable::check_constraints`.

Testing:
 - new regression test
 - tiers 1-4

Thanks

PS. The diff is much smaller if you disable whitespace differences.

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

Commit messages:
 - regression test
 - 8356942: invokeinterface Throws AbstractMethodError Instead of IncompatibleClassChangeError

Changes: https://git.openjdk.org/jdk/pull/26122/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26122&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356942
  Stats: 128 lines in 6 files changed: 83 ins; 6 del; 39 mod
  Patch: https://git.openjdk.org/jdk/pull/26122.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26122/head:pull/26122

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


More information about the hotspot-runtime-dev mailing list