Not if you use Lookup.findSpecial() [1] Anyway, you can not use it because you can not get the Lookup object associated with the proxy class.
That's why i've written the Proxy2 library [2]. so the solutions are either you use the Proxy2 library (which doesn't work with jdk9 yet) or we retrofit the interface InvocationHandler to take a supplementary Lookup object. regards, Rémi [1] http://docs.oracle.com/javase/7/docs/api/java/lang/invoke/MethodHandles.Lookup.html#findSpecial%28java.lang.Class,%20java.lang.String,%20java.lang.invoke.MethodType,%20java.lang.Class%29 [2] https://github.com/forax/proxy2 ----- Mail original ----- > De: "Jochen Theodorou" <blackd...@gmx.org> > À: "Alan Bateman" <alan.bate...@oracle.com> > Cc: "jigsaw-dev" <jigsaw-dev@openjdk.java.net> > Envoyé: Jeudi 26 Mai 2016 09:21:15 > Objet: Re: creating proxies for interfaces with default methods > > On 26.05.2016 09:03, Alan Bateman wrote: > > On 26/05/2016 07:04, Jochen Theodorou wrote: > >> > >> you cannot invoke the default method with reflection without > >> implementation of the interface > > It sounds like you want to invoke the default method without a receiver. > > This does seem like sorcery for mlvm-dev. > > the problem is, that if I use a dynamic proxy as receiver and reflection > as invocation method, I will end up in the invocation hadler again. > > bye Jochen > >