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

2017-03-02 Thread Remi Forax
nvoyé: Jeudi 2 Mars 2017 09:28:35 > Objet: Re: Proposal: java.lang.reflect.Proxy and default methods > 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()/unreflectSp

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

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

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

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

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

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

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

2016-06-05 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

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