RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags [v4]

liach duke at openjdk.java.net
Wed Jan 26 00:09:36 UTC 2022


On Tue, 25 Jan 2022 22:01:22 GMT, Johannes Kuhn <jkuhn at openjdk.org> wrote:

> My question was for when a library wants to implement something similar to `MethodHandleProxies.asInterfaceInstace`, and for example supports Interfaces with more than a single abstract method. Currently, such a library would also have to call `ReflectAccess.invokeDefault`, as the interface may not be accessible by the `InvocationHandler` (as it could be the case with `MethodHandleProxies.asInterfaceInstace`
> 
> But this might be a discussion for an other time. Patch looks good.

They will probably accept a `MethodHandles.Lookup` object to define a class for such a single-interface instance plus calling the default methods beyond the restrictions.

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

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


More information about the core-libs-dev mailing list