creating proxies for interfaces with default methods
Alan Bateman
Alan.Bateman at oracle.com
Fri May 27 08:16:10 UTC 2016
On 27/05/2016 06:28, Jochen Theodorou wrote:
> :
>
>> MethodHandles.Lookup.class.getDeclaredConstructor(Class.class,
>> int.class).
>> newInstance(interfaceClass, MethodHandles.Lookup.PRIVATE).
>> unreflectSpecial(method, interfaceClass).
>> bindTo(receiver);
>
> but that is not working anymore.
I don't think it's possible to create a Lookup via support API with just
the PRIVATE lookup mode. It only seems to work because this code seems
to hack into the non-public constructor. I'm curious if you invoke
toString on this, with JDK 8 and with -esa, as I assume you will get a
similar assertion.
-Alan
More information about the jigsaw-dev
mailing list