Re: creating proxies for interfaces with default methods

2016-07-24 Thread forax
: "John Rose" , "Alan Bateman" > > Cc: "Rémi Forax" , "jigsaw-dev" > > Envoyé: Samedi 23 Juillet 2016 08:59:49 > Objet: Re: creating proxies for interfaces with default methods > On 23.07.2016 01:12, John Rose wrote: >> On May 27, 2016

Re: creating proxies for interfaces with default methods

2016-07-24 Thread Alan Bateman
On 23/07/2016 00:12, John Rose wrote: The Lookup API does not have a "setAccessible" analog. Maybe it should; along the lines of Unsafe.privateLookup(Class). Would this be the internal Unsafe or sun.misc.Unsafe? I just wonder if this is something that would be regretted in the future. For t

Re: creating proxies for interfaces with default methods

2016-07-23 Thread Jochen Theodorou
On 23.07.2016 01:12, John Rose wrote: On May 27, 2016, at 1:16 AM, Alan Bateman mailto:alan.bate...@oracle.com>> wrote: I don't think it's possible to create a Lookup via support API with just the PRIVATE lookup mode. It only seems to work because this code seems to hack into the non-public con

Re: creating proxies for interfaces with default methods

2016-07-22 Thread John Rose
On May 27, 2016, at 1:16 AM, Alan Bateman wrote: > > I don't think it's possible to create a Lookup via support API with just the > PRIVATE lookup mode. It only seems to work because this code seems to hack > into the non-public constructor. I'm curious if you invoke toString on this, > with J

Re: creating proxies for interfaces with default methods

2016-05-27 Thread Alan Bateman
On 27/05/2016 06:28, Jochen Theodorou wrote: : MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, int.class). newInstance(interfaceClass, MethodHandles.Lookup.PRIVATE). unreflectSpecial(method, interfaceClass). bindTo(receiver); but that is not working anymore.

Re: creating proxies for interfaces with default methods

2016-05-27 Thread Jochen Theodorou
On 27.05.2016 08:58, fo...@univ-mlv.fr wrote: - Mail original - De: "Jochen Theodorou" À: "Remi Forax" Cc: "jigsaw-dev" Envoyé: Vendredi 27 Mai 2016 07:28:58 Objet: Re: creating proxies for interfaces with default methods On 26.05.2016 14:00, Rem

Re: creating proxies for interfaces with default methods

2016-05-26 Thread forax
- Mail original - > De: "Jochen Theodorou" > À: "Remi Forax" > Cc: "jigsaw-dev" > Envoyé: Vendredi 27 Mai 2016 07:28:58 > Objet: Re: creating proxies for interfaces with default methods > > On 26.05.2016 14:00, Remi Forax wrote: >

Re: creating proxies for interfaces with default methods

2016-05-26 Thread Jochen Theodorou
On 26.05.2016 14:00, Remi Forax wrote: Not if you use Lookup.findSpecial() [1] Anyway, you can not use it because you can not get the Lookup object associated with the proxy class. which is why I did this: MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, int.class).

Re: creating proxies for interfaces with default methods

2016-05-26 Thread Remi Forax
ss%29 [2] https://github.com/forax/proxy2 - Mail original - > De: "Jochen Theodorou" > À: "Alan Bateman" > Cc: "jigsaw-dev" > Envoyé: Jeudi 26 Mai 2016 09:21:15 > Objet: Re: creating proxies for interfaces with default methods > > On 26.

Re: creating proxies for interfaces with default methods

2016-05-26 Thread Jochen Theodorou
On 26.05.2016 09:03, Alan Bateman wrote: On 26/05/2016 07:04, Jochen Theodorou wrote: you cannot invoke the default method with reflection without implementation of the interface It sounds like you want to invoke the default method without a receiver. This does seem like sorcery for mlvm-dev.

Re: creating proxies for interfaces with default methods

2016-05-26 Thread Alan Bateman
On 26/05/2016 07:04, Jochen Theodorou wrote: you cannot invoke the default method with reflection without implementation of the interface It sounds like you want to invoke the default method without a receiver. This does seem like sorcery for mlvm-dev. -Alan

Re: creating proxies for interfaces with default methods

2016-05-25 Thread Jochen Theodorou
On 25.05.2016 22:32, Mandy Chung wrote: On May 25, 2016, at 1:12 PM, Jochen Theodorou wrote: Dynamic proxies and invocation handlers won't do the job, as they do not provide an implementation of the interface I can call the default method on. Is this a general limitation of j.l.r.Proxy? At

Re: creating proxies for interfaces with default methods

2016-05-25 Thread Mandy Chung
> On May 25, 2016, at 1:12 PM, Jochen Theodorou wrote: > >>> Dynamic proxies and invocation handlers won't do the job, as they do not >>> provide an implementation of the interface I can call the default method >>> on. >> >> Is this a general limitation of j.l.r.Proxy? At first glance it doesn'

Re: creating proxies for interfaces with default methods

2016-05-25 Thread Jochen Theodorou
On 25.05.2016 20:08, Alex Buckley wrote: On 5/25/2016 12:22 AM, Jochen Theodorou wrote: so in earlier mails to this list I described a bit the problems I got into with the way Groovy produces proxies and handles default methods for those. Pointer? The most relevant thread I could find was "Gro

Re: creating proxies for interfaces with default methods

2016-05-25 Thread Alex Buckley
On 5/25/2016 12:22 AM, Jochen Theodorou wrote: so in earlier mails to this list I described a bit the problems I got into with the way Groovy produces proxies and handles default methods for those. Pointer? The most relevant thread I could find was "Groovy with Jigsaw" from September 2015 but