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

2022-01-25 Thread Mandy Chung
On Wed, 26 Jan 2022 00:06:25 GMT, liach wrote: > 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. Yes, that's one option. Such library should take a Lookup parameter to

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

2022-01-25 Thread liach
On Tue, 25 Jan 2022 22:01:22 GMT, Johannes Kuhn 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 >

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

2022-01-25 Thread Johannes Kuhn
On Tue, 25 Jan 2022 21:35:27 GMT, Mandy Chung 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

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

2022-01-25 Thread Mandy Chung
> 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 o

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

2022-01-25 Thread Alan Bateman
On Tue, 25 Jan 2022 17:20:50 GMT, Mandy Chung wrote: > What about this: Looks okay, main thing is to have it be consistent with the existing methods. - PR: https://git.openjdk.java.net/jdk/pull/7185

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

2022-01-25 Thread Mandy Chung
On Tue, 25 Jan 2022 14:36:26 GMT, Alan Bateman wrote: >> Mandy Chung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix accident argument ordering after edit > > src/java.base/share/classes/jdk/internal/access/JavaLangReflectAccess.java

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

2022-01-25 Thread Alan Bateman
On Mon, 24 Jan 2022 23:13:24 GMT, Mandy Chung wrote: > To invoke the default method, the caller will need access to the declaring > interface of the default method (via bytecode invocation or reflection). The > bug I had was because java.base (the module of the invocation handler) does > not h

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

2022-01-25 Thread Alan Bateman
On Mon, 24 Jan 2022 23:18:41 GMT, Mandy Chung 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

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

2022-01-24 Thread Mandy Chung
On Mon, 24 Jan 2022 23:02:52 GMT, Johannes Kuhn wrote: >> Mandy Chung has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - revert MethodHandlesProxiesTest change >> - Add new regression test >> - Should not perform access check on the i

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

2022-01-24 Thread Mandy Chung
> 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 o

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

2022-01-24 Thread Johannes Kuhn
On Mon, 24 Jan 2022 23:03:49 GMT, Mandy Chung 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

Re: RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-24 Thread Mandy Chung
On Sat, 22 Jan 2022 21:48:38 GMT, Johannes Kuhn 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::invokeDefau

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

2022-01-24 Thread Mandy Chung
> 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 o

Re: RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-22 Thread Johannes Kuhn
On Fri, 21 Jan 2022 22:49:38 GMT, Mandy Chung 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` > me

Re: RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-22 Thread Alan Bateman
On Fri, 21 Jan 2022 22:49:38 GMT, Mandy Chung 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` > me

Re: RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-21 Thread Mandy Chung
On Fri, 21 Jan 2022 23:16:50 GMT, liach wrote: > Will older versions up to Java 8 get an alternative fix (changing the > accessed handle to non-vararg) too? This is up to the update release maintainers to decide. The backport fix is straight-forward. I include that in the JBS report. -

Re: RFR: 8280377: MethodHandleProxies does not correctly invoke default methods with varags

2022-01-21 Thread liach
On Fri, 21 Jan 2022 22:49:38 GMT, Mandy Chung 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` > me

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

2022-01-21 Thread Mandy Chung
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 prox