Nest host validation vs NestHost attribute performed by Lookup::defineHiddenClass

Mandy Chung mandy.chung at oracle.com
Wed Oct 2 17:07:58 UTC 2019



On 10/2/19 2:11 AM, Peter Levart wrote:
> Ok, I see now that it is best for getNestMates() to be static only. In 
> case of a nest with a normal named NH, this method would only return 
> the statically defined mates without any hidden classes added 
> dynamically. So why would this method need to return any members for 
> hidden only nest? This would mean that it behaves differently 
> depending on whether there is a normal named class in the nest or not.

getNestMembers does not return any dynamically added members regardless 
of the host is a hidden class or non-hidden.    It returns an array of 
at least one element, the zeroth element is the nest host which can be a 
hidden class.  So for a hidden only nest, I see getNestMembers behaves 
consistently with an ordinary class with no NH attribute (i.e. no static 
members) and returns 1-element array consisting only the nest host.

Mandy


More information about the valhalla-dev mailing list