JLS spec changes for nestmates
daniel.smith at oracle.com
Thu Dec 21 20:18:04 UTC 2017
> On Dec 19, 2017, at 1:50 PM, David Holmes <David.Holmes at oracle.com> wrote:
> On 19/12/2017 6:53 AM, Dan Smith wrote:
>>> On Dec 17, 2017, at 6:15 PM, David Holmes <David.Holmes at oracle.com> wrote:
>>>> I looked over 13.1, and think it does a fine job of allowing binaries to use the NestHost and NestMembers attributes without any changes (see items 9 and 10 in the second list).
>>> I don't follow. Items 9 and 10 seem to pertain to the InnerClasses attribute. NestHost and NestMembers can not, in general, be used to convey the information required by items 9 and 10. The NestHost attribute need not refer to the immediately enclosing class. The NestMembers attribute only appears in the top-level NestHost class.
>> Yeah, you're right. This section is very hand-wavy, so I tend to give it some latitude to say things that aren't exactly right. And there's a difference between _allowing_ a reference to something and _requiring_ it. But we could probably do a better job here and require the references we expect to appear in NestHost/NestMembers.
> But I didn't think it was a requirement to use the new attributes. I thought a source compiler could choose to continue to generate bridge accessors and not need the new attributes? (That's what the JEP implies.)
Yep, ran this by Maurizio, he agrees it's optional.
So it seems like the right thing to do is leave 13.1 unchanged. As far as I can tell, an implementation can choose to add references to classes that aren't enumerated in 13.1, and we don't need to say anything about it.
More information about the valhalla-spec-observers