On Fri, 18 Oct 2024 16:54:59 GMT, Mandy Chung <mch...@openjdk.org> wrote:
>> Oh that's a good find. Maybe we should write a test for this, if as I >> assume there isn't one already. >> Edit: not with this RFE, just in general. > >> // If the loader is not the boot loader then throw an exception if its >> // superclass is in package jdk.internal.reflect > > This will never happen. `jdk.internal.reflect` is a non-exported package in > `java.base` module. If another module `M` defines a class whose superclass > is in `jdk.internal.reflect` package, `java.base` must export > `jdk.internal.reflect` package to `M` for access. Otherwise, it will fail > the super access check, as done in the check below this deleted code. > > > Reflection::VerifyClassAccessResults vca_result = > Reflection::verify_class_access(this_klass, InstanceKlass::cast(super), > false); `test/hotspot/jtreg/runtime/AccessCheckSuper.java` is one test that fails the super class access check. @lfoltan may know whether there are more tests besides this one. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21571#discussion_r1806804666