java.lang.reflect.Proxy and default methods

Peter Levart peter.levart at marand.si
Tue Aug 28 02:18:55 PDT 2012


Currently java.lang.reflect.Proxy treats default interface methods the same as 
abstract methods (it passes their invocations to the InvocationHandler), which 
is the right thing to do if current platform interfaces like Iterator will 
have some abstract methods turned into default methods.

But if at the same time interfaces like Iterable get new default methods, 
libraries that expose proxies to those interfaces will have to be prepared 
(modified) to handle invocations to those new methods.

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?

Regards, Peter


More information about the lambda-dev mailing list