Runtime code generation and barriers in migrating away from JVM-interal APIs

Peter Levart peter.levart at gmail.com
Sun Jan 7 16:40:40 UTC 2018


Hi Rafael,

On 01/07/18 13:10, Volker Simonis wrote:
> At a result, even with Java 9 being supported by many popular frameworks, a
> migration away from internal APIs has not yet been achieved. I would
> therefore like to suggest the following extensions:
>
> C) When a module opens a package, other modules should gain package access
> to this package when creating method handle lookups. This way, if a user
> opens a package containing Spring beans to the Spring framework, it could
> proxy all of these beans as it does today. Since opening a package also
> permits reflection on package-private types and methods of this package,
> this is not a security concern either.

Have you checked the new JDK 9 method: 
java.lang.invoke.MethodHandles#privateLookupIn ?

I believe it should do the trick.

Regards, Peter



More information about the jdk-dev mailing list