Re: RFR: 8210943: Hiding of inner classes not resolved properly

2018-12-01 Thread Attila Szegedi
Huh… so even within the single array returned from a single call to Classes.getClasses() we can have two classes of the same short name? I foolishly presumed this wouldn’t be the case. I guess in this case the full solution would indeed to provide an ordering on the classes, first on the name,

Re: RFR: 8210943: Hiding of inner classes not resolved properly

2018-12-01 Thread Hannes Wallnöfer
Attila, the subclass-to-superclass traversal is actually not done in dynalink but directly in java.lang.Class.getClasses(). So Sundar has a point in that my code relies on implementation rather than specified behaviour of Class.getClasses(). Now I do think it is highly unlikely that the order

Re: RFR: 8210943: Hiding of inner classes not resolved properly

2018-12-01 Thread Attila Szegedi
The relevant Dynalink algorithm processes the class before moving on to superclass, so Hannes fix is correct in that we won’t stomp over a subclass’ inner class (inserted into the map earlier) with the superclass’ inner class (encountered later by the algorithm). So yeah, getClasses() doesn’t

Re: RFR: 8210943: Hiding of inner classes not resolved properly

2018-11-30 Thread Sundararajan Athijegannathan
That should have been "do I miss something here?" :) -Sundar On 01/12/18, 11:43 AM, Sundararajan Athijegannathan wrote: Class.getClasses() javadoc does not mention anything about order of classes returned. https://docs.oracle.com/javase/10/docs/api/java/lang/Class.html#getClasses() Do we

Re: RFR: 8210943: Hiding of inner classes not resolved properly

2018-11-30 Thread Sundararajan Athijegannathan
Class.getClasses() javadoc does not mention anything about order of classes returned. https://docs.oracle.com/javase/10/docs/api/java/lang/Class.html#getClasses() Do we need a check using Class.getDeclaringClass() or do I something here? Thanks, -Sundar On 30/11/18, 4:44 PM, Attila Szegedi

Re: RFR: 8210943: Hiding of inner classes not resolved properly

2018-11-30 Thread Jim Laskey
+1 > On Nov 29, 2018, at 1:01 PM, Hannes Wallnöfer > wrote: > > Please review: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 > Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ > > AccessibleMembersLookup#lookupAccessibleMembers adds all nested classes > returned

Re: RFR: 8210943: Hiding of inner classes not resolved properly

2018-11-30 Thread Attila Szegedi
+1. Thanks for fixing this. > On 2018. Nov 29., at 18:01, Hannes Wallnöfer > wrote: > > Please review: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 > Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ > > AccessibleMembersLookup#lookupAccessibleMembers adds all

RFR: 8210943: Hiding of inner classes not resolved properly

2018-11-29 Thread Hannes Wallnöfer
Please review: Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ AccessibleMembersLookup#lookupAccessibleMembers adds all nested classes returned by Class.getClasses(), but these may contain inherited classes that are shadowed