Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2016-07-25 Thread Martin Buchholz
I filed a couple of bugs. Here's a relevant JIRA search: https://bugs.openjdk.java.net/issues/?jql=Subcomponent%20%3D%20java.lang%3Areflect%20AND%20watcher%20%3D%20martin Because of the trickiness of local vs inner classes, Alex may want to make a decision on the correct behavior. On Fri, Jul

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2016-07-22 Thread Martin Buchholz
Bug 8029042: Receiver parameter not supported on local class constructor also suggests that a local class of an instance method "is a perfectly good inner class" and so getAnnotatedReceiverType should treat them equivalently. On Thu, Jul 21, 2016 at 11:50 AM, Joel Borggrén-Franck <

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2016-07-21 Thread David Holmes
On 22/07/2016 4:50 AM, Joel Borggrén-Franck wrote: This is the first time I noticed the second paragraph of $14.3, strange indeed! I'd ping compiler-dev with this, Alex will probably know if this is a spec bug in $14.3 or just an irregularity. It is an irregularity - for want of a better word.

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2016-07-21 Thread Joel Borggrén-Franck
This is the first time I noticed the second paragraph of $14.3, strange indeed! I'd ping compiler-dev with this, Alex will probably know if this is a spec bug in $14.3 or just an irregularity. Cheers /Joel On Jul 21, 2016 20:39, "Martin Buchholz" wrote: > Joel, Thanks for

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2016-07-21 Thread Martin Buchholz
Joel, Thanks for responding so quickly! Here' s a slightly modified version of my repro recipe: You can see that local classes in instance methods have a receiver type, just like a member inner class. local classes in static methods (naturally!) do not. I expect the two flavors of local classes

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2016-07-21 Thread Joel Borggrén-Franck
Hi Martin, I'm away from my workstation at the moment, so this is from memory. IIRC a local class is pure scoping and lacks an "outer this" which is what you annotate for constructors. There should not be receiver type to annotate. Since I can't run your code I can't see what's wrong but I might

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2016-07-21 Thread Martin Buchholz
Hi Joel, Paul, A coworker ran into the change of behavior here in jdk9. Specifically, we noticed that a local class constructor has a receiver parameter, but getAnnotatedReceiverType returns null. The changed jdk9 spec is actually very clear about that:

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2014-08-13 Thread Joel Borggren-Franck
Hi Paul, On 2014-06-24, Paul Sandoz wrote: On Jun 17, 2014, at 6:52 PM, Joel Borggrén-Franck joel.fra...@oracle.com wrote: Can I get a review for this fix and javadoc clarification for https://bugs.openjdk.java.net/browse/JDK-8044629 +1 I never quite realised just how

Re: RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2014-06-24 Thread Paul Sandoz
On Jun 17, 2014, at 6:52 PM, Joel Borggrén-Franck joel.fra...@oracle.com wrote: Hi, Can I get a review for this fix and javadoc clarification for https://bugs.openjdk.java.net/browse/JDK-8044629 The problem is with potentially annotated receiver parameters, they only exist for inner

RFR: JDK-8044629: (reflect) Constructor.getAnnotatedReceiverType() returns wrong value

2014-06-17 Thread Joel Borggrén-Franck
Hi, Can I get a review for this fix and javadoc clarification for https://bugs.openjdk.java.net/browse/JDK-8044629 The problem is with potentially annotated receiver parameters, they only exist for inner class constructors, so this fix makes sure that a ctor is for an inner class or returns