Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-08-13 Thread Daniel Fuchs
Hi Mandy, This looks good to me. best regards, -- daniel On 31/07/2019 21:59, Mandy Chung wrote: Hi Peter, Daniel [...] This is correct when this class is a subclass of C.   A slight clarification to indicate that aMethod's declaring class is C might help.  I also fixed another typo:

Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-31 Thread Mandy Chung
Hi Peter, Daniel On 7/31/19 1:44 AM, Peter Levart wrote: On 7/31/19 9:59 AM, Peter Levart wrote: Hi, I think Daniel is talking about the "dispatch" semantics of unreflectSpecial here, right Daniel? Thanks for clarifying this. The findSpecial / unreflectSpecial is a MethodHandle

Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-31 Thread Daniel Fuchs
Hi Peter, Mandy, On 31/07/2019 09:44, Peter Levart wrote: Expanding on this a little. The javadocs of MethodHandles.Lookup starts talking about the Lookup factory methods methods and their equivalence to bytecode instructions, but then present the equivalence between find* and Java source

Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-31 Thread Daniel Fuchs
Hi Peter, Mandy, On 31/07/2019 08:59, Peter Levart wrote: Hi, I think Daniel is talking about the "dispatch" semantics of unreflectSpecial here, right Daniel? Yes, exactly! The findSpecial / unreflectSpecial is a MethodHandle equivalent for bytecode instruction invokespecial (sans actual

Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-31 Thread Peter Levart
On 7/31/19 9:59 AM, Peter Levart wrote: Hi, I think Daniel is talking about the "dispatch" semantics of unreflectSpecial here, right Daniel? The findSpecial / unreflectSpecial is a MethodHandle equivalent for bytecode instruction invokespecial (sans actual invoking). invokespecial is

Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-31 Thread Peter Levart
Hi, I think Daniel is talking about the "dispatch" semantics of unreflectSpecial here, right Daniel? The findSpecial / unreflectSpecial is a MethodHandle equivalent for bytecode instruction invokespecial (sans actual invoking). invokespecial is typically used for implementing the

Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-30 Thread Mandy Chung
Think about aMethod is a protected method inherited from its superclass T.  To invoke aMethod, the receiver must be an instance of T or a subclass of T. Mandy On 7/30/19 3:22 AM, Daniel Fuchs wrote: Hi Mandy,  380  * {@link java.lang.invoke.MethodHandles.Lookup#unreflectSpecial

Re: Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-26 Thread Mandy Chung
Daniel noticed that `unreflectSpecial` is missing in the "Lookup Factory Methods" section in the class spec.  In fact there are a duplicated `lookup.unreflect(aMethod)` row that might originally be for `unreflectSpecial`.   I fix the javadoc in this patch:

Review Request: JDK-8209005: Lookup.unreflectSpecial fails for default methods when Lookup.findSpecial works

2019-07-25 Thread Mandy Chung
This patch fixes Lookup.unreflectSpecial to pass the declaring class of Method being unreflected (rather than null) so that it can accurately check if the special caller class is either the lookup class or a superinterface of the declaring class. Webrev: