Final nestmates spec

Dan Smith daniel.smith at oracle.com
Fri Dec 15 18:44:42 UTC 2017


> On Dec 12, 2017, at 12:52 AM, David Holmes <David.Holmes at 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.

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.

—Dan


More information about the valhalla-spec-observers mailing list