On Mon, 1 May 2023 22:11:58 GMT, John R Rose <jr...@openjdk.org> wrote:
> JDK platform code Yes. This works if the class is in a non-user module. Otherwise exporting an internal package would expose that to user-code as well. `java.lang.reflect.Proxy` does need to inject the proxy class into user-packages if one interface is non-public, so it could not use that. > I haven’t looked at the proxy code lately but I imagine that it minimizes the > number of spun classes for similar reasons. Yes, it caches the proxy class with the tuple `(ClassLoader, interfaces)`. The order of the interfaces matters. ------------- PR Comment: https://git.openjdk.org/jdk/pull/13197#issuecomment-1530446571