Hi Dan,
On 16/12/2017 4:44 AM, Dan Smith wrote:
On Dec 12, 2017, at 12:52 AM, David Holmes <david.hol...@oracle.com> wrote:
Hi Dan,
I have one query with regards to the processing of the NestMembers attribute. Originally
when I wrote the draft I copied the InnerClasses text and that included prohibiting
duplicate entries in NestMembers. You dropped that restriction from the spec (though I
haven't yet removed it from the VM). How does that interact with the
Class.getNestMembers() API? Should it return the raw NestMembers contents (which may
include duplicates - including additional references to "self") or should it
return the set of members (ie no duplicates, including self)?
Just one thing I'll add: is 'getNestMembers' meant to give clients a raw view
the NestMembers attribute, or to tell them what is in the nest? My sense is
that the latter is the goal, and so the method should use the attribute as a
tool to inform its result, but it *shouldn't* just regurgitate what it reads.
That conflicts with what John suggested.
A good litmus test: should the result contain the current class or not? If it
does, you're giving clients a polished list of actual nest members. If it does
not, you're just repeating to clients what the attribute says.
The result should of course contain the current class - if it is the
nest host it is always returned as the zeroeth element. I don't see how
that relates to "polished" versus "regurgitated? getNetsMembers()
doesn't mean "read the Nestmember attribute of this class", it means "
get all the nest members of the nest in which this class is a member".
Thanks,
David
—Dan