On Fri, 21 Jan 2022 22:49:38 GMT, Mandy Chung <mch...@openjdk.org> wrote:

> The MethodHandle of a default method should be made as a fixed arity method 
> handle because it is invoked via Proxy's invocation handle with a non-vararg 
> array of arguments.  On the other hand, the `InvocationHandle::invokeDefault` 
> method  was added in Java 16 to invoke a default method of a proxy instance.  
> This patch simply converts the implementation to call 
> `InvocationHandle::invokeDefault` instead.

Will older versions up to Java 8 get an alternative fix (changing the accessed 
handle to non-vararg) too? This API is currently the most backward-compatible 
way to create a proper (as in calling default methods as desired) interface 
proxy in Java 8 or 11.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7185

Reply via email to