java.lang.reflect.Proxy and default methods

Steven Simpson ss at comp.lancs.ac.uk
Tue Aug 28 05:22:10 PDT 2012


On 28/08/12 10:18, Peter Levart wrote:
> Sometimes the library writer might just want to pass default method
> invocations to the default method implementations in the interface. Will there
> be a reflection facility to call super interface methods on the proxy instance
> or is there anything else planned to facilitate this?

How about a default method on InvocationHandler?:

   Object invoke(Object proxy, Method method,
                 Object[] args,
                 Foo defaultImpl) throws Throwable
   default {
     return defaultImpl.invoke();
   }





More information about the lambda-dev mailing list