Re: Proposal: java.lang.reflect.Proxy and default methods

2017-03-02 Thread Remi Forax
Alan, i think we should update the doc section of j.l.r.Proxy to add a sentence about default methods ? Rémi - Mail original - > De: "Alan Bateman" > À: "mp911de" , [email protected] > Envoyé: Jeudi 2 Mars 2017 09:28:35 > Objet: Re: Propo

Re: Proposal: java.lang.reflect.Proxy and default methods

2017-03-02 Thread Alan Bateman
On 01/03/2017 21:14, mp911de wrote: Is there any progress on this issue? In the light of Java 9, the workaround with MethodHandles.lookup()/unreflectSpecial does not work anymore because MethodHandles is encapsulated and calling setAccessible(true) on the constructor fails. Resolving method han

Re: Proposal: java.lang.reflect.Proxy and default methods

2017-03-01 Thread Mandy Chung
You can use MethodHandles.privateLookupIn (new in JDK 9) to replace Constructor hack to get a Lookup object with private access for the target class. Mandy > On Mar 1, 2017, at 9:14 PM, mp911de wrote: > > Is there any progress on this issue? In the light of Java 9, the workaround > with > Meth

Re: Proposal: java.lang.reflect.Proxy and default methods

2017-03-01 Thread Steven Schlansker
> On Mar 1, 2017, at 1:14 PM, mp911de wrote: > > Is there any progress on this issue? In the light of Java 9, the workaround > with > MethodHandles.lookup()/unreflectSpecial does not work anymore because > MethodHandles is encapsulated and calling setAccessible(true) on the > constructor fails.

Re: Proposal: java.lang.reflect.Proxy and default methods

2017-03-01 Thread mp911de
Is there any progress on this issue? In the light of Java 9, the workaround with MethodHandles.lookup()/unreflectSpecial does not work anymore because MethodHandles is encapsulated and calling setAccessible(true) on the constructor fails. Resolving method handles inside the same module seems to wo

Re: Proposal: java.lang.reflect.Proxy and default methods

2016-06-16 Thread Steven Schlansker
> On Jun 16, 2016, at 12:29 PM, Mandy Chung wrote: > > Can you elaborate how proxy and default methods affects your library to able > to run with security manager? So in this particular case, I wanted to create an interface type where some methods are automatically generated from declarative

Re: Proposal: java.lang.reflect.Proxy and default methods

2016-06-16 Thread Mandy Chung
Can you elaborate how proxy and default methods affects your library to able to run with security manager? This is a good enhancement. I have created a JBS issue to track that [1]. There is no such existing enhancement request in JBS. Mandy [1] https://bugs.openjdk.java.net/browse/JDK-8159746

Re: Proposal: java.lang.reflect.Proxy and default methods

2016-06-16 Thread Steven Schlansker
Hi everyone, I am glad this was discussed on the list again. I just wanted to throw out there, as a library developer and end user, I now have had to reproduce this hack in no fewer than four different projects for various reasons. It is even worse because it means that my library cannot run unde

Re: Proposal: java.lang.reflect.Proxy and default methods

2016-06-06 Thread Mandy Chung
Hi Peter, Thanks for the proposal. This feature has been lacking. When this subject was brought, I also have similiar thought to provide a way in Proxy class for InvocationHandler to invoke a default method (but of course no time to put into it). I appreciate your contribution and good work.

Re: Proposal: java.lang.reflect.Proxy and default methods

2016-06-05 Thread Peter Levart
Hi Jake, On 06/05/2016 08:28 AM, Jake Wharton wrote: On Fri, Jun 3, 2016 at 10:58 AM Peter Levart > wrote: InvocationHandler gets invoked for default methods, but it has not provision to forward such calls to the default implementations in the interfa

Re: Proposal: java.lang.reflect.Proxy and default methods

2016-06-04 Thread Jake Wharton
On Fri, Jun 3, 2016 at 10:58 AM Peter Levart wrote: > InvocationHandler gets invoked for default methods, but it > has not provision to forward such calls to the default implementations > in the interfaces. > This isn't quite true. You can use MethodHandles to invoke the default method if the in

Proposal: java.lang.reflect.Proxy and default methods

2016-06-03 Thread Peter Levart
Hi, Since Java SE 8 introduced default methods in interfaces there was a question what to do with java.lang.reflect.Proxy API. Nothing was done to the API at that time, so the default behavior is to proxy default methods too. InvocationHandler gets invoked for default methods, but it has not