On Fri, 26 May 2023 22:05:06 GMT, Mandy Chung <mch...@openjdk.org> wrote:
>>> 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. > > If we can avoid implementing `sun.invoke.WrapperInstance`, this package > access check issue would go away. Do you think you can look into it? I think we can probably insert a static final field in a wrapper instance class to point to the implemented class and verify with the `PROXY_CLASS_INFOS` ClassValue, much like VarForm field in VarHandle implementations. This should have less reflective impact than the annotation-based approach, and can be cached in a ClassValue as well. Should we cache it though? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13197#discussion_r1207426728