RFR: 8261532: Archived superinterface class cannot be accessed

Calvin Cheung ccheung at openjdk.java.net
Wed Mar 3 23:45:07 UTC 2021


Problem: If an interface is in the CDS archive but not the class which implements the interface. During runtime, IllegalAccessError will result when the class is being loaded.

Fix:
In `InstanceKlass::set_packge()` when checking if we can use a saved copy of the` _package_entry`, add a NULL check for `_package_entry` before returning. In `SystemDictionaryShared::prepare_shared_lambda_proxy_class()`, we can obtain the `_package_entry` directly from the `caller_ik` instead of calling `get_package_entry_from_class()`.

Testing: passed mach5 tiers 1 - 4 tests.

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

Commit messages:
 - fix trailing whitespace
 - 8261532: Archived superinterface class cannot be accessed

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

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


More information about the hotspot-runtime-dev mailing list