On Fri, 26 May 2023 22:18:17 GMT, Chen Liang <li...@openjdk.org> wrote:
>> 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? Is it more straight-forward to keep a `ClassValue<Boolean>` and each wrapper instance class has an entry of `TRUE` value; otherwise, `FALSE`? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13197#discussion_r1210952258