RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

Mandy Chung mchung at openjdk.org
Fri May 26 22:08:17 UTC 2023


On Fri, 26 May 2023 21:31:40 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Yes. Unfortunately, it fails at https://github.com/openjdk/jdk/blob/bd21e68e679c41c98f39dd2fbd38270ae7d55ed9/src/java.base/share/classes/java/lang/SecurityManager.java#L1317 because a conditionally-exported package is considered a non-(unconditionally-)exported package.
>
> If we keep a cache of all MHProxy classes, I think this would not need `sun.invoke.WrapperInstance`.   OTOH, `sun.invoke` does not have any other class except `WrapperInstance` and the `ensureOriginalLookup` method would need to be in an internal class.   So no problem of implementing `sun.invoke.WrapperInstance`.

> because a conditionally-exported package is considered a non-(unconditionally-)exported package.

OK.  I need to look into the right solution for this.   The Proxy implementation uses null protection domain to define the proxy class whereas this patch uses the protection domain as the interface to define the MHProxy class.  That's why this issue only occurs in this new implementation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13197#discussion_r1207415941


More information about the core-libs-dev mailing list