Proposal: java.lang.reflect.Proxy and default methods
Mandy Chung
mandy.chung at oracle.com
Wed Mar 1 23:14:03 UTC 2017
You can use MethodHandles.privateLookupIn (new in JDK 9) to replace Constructor hack to get a Lookup object with private access for the target class.
Mandy
> On Mar 1, 2017, at 9:14 PM, mp911de <mpaluch at paluch.biz> wrote:
>
> Is there any progress on this issue? In the light of Java 9, the workaround
> with
> MethodHandles.lookup()/unreflectSpecial does not work anymore because
> MethodHandles is encapsulated and calling setAccessible(true) on the
> constructor fails.
>
> Resolving method handles inside the same module seems to work with public
> lookup,
> but as soon as a module defines an interface with default methods and this
> interface is called by a proxy handler that comes from a different module,
> it's
> no longer possible to resolve the MethodHandle.
>
> Is this the appropriate mailing list for this case?
>
>
>
> --
> View this message in context: http://openjdk.5641.n7.nabble.com/Proposal-java-lang-reflect-Proxy-and-default-methods-tp273894p300249.html
> Sent from the OpenJDK Core Libraries mailing list archive at Nabble.com.
More information about the core-libs-dev
mailing list