RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags [v3]
Alan Bateman
alanb at openjdk.java.net
Tue Jan 25 14:41:36 UTC 2022
On Mon, 24 Jan 2022 23:18:41 GMT, Mandy Chung <mchung at 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.
>
> Mandy Chung has updated the pull request incrementally with one additional commit since the last revision:
>
> fix accident argument ordering after edit
Marked as reviewed by alanb (Reviewer).
src/java.base/share/classes/jdk/internal/access/JavaLangReflectAccess.java line 107:
> 105:
> 106: public Object invokeDefault(Object proxy, Method method, Object[] args, Class<?> caller)
> 107: throws Throwable;
Minor nit: add a comment to the method so that it's consistent with the other JLRA methods.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7185
More information about the core-libs-dev
mailing list