Generation of NestHost and NestMembers attributes using javac?
Remi Forax
forax at univ-mlv.fr
Tue Jul 3 06:35:28 UTC 2018
Hi Ess,
the specification of NestHost/NestMember attributes is independent of the InnerClass attribute.
The former specifies that there is a private access among the members of the nest the later indicates that the classes comes from the same source files.
For javac currently, a nest member is an inner class of the nest host, so the attributes or more or less aligned, but for other languages than Java this may not be the case and in the future, for Java this may not be the case too. Another example, a JavaEE (like) container may generate proxy classes that are nest members of the proxied class without the proxy being an inner class of the proxied class.
cheers,
Rémi
----- Mail original -----
> De: "Ess Kay" <s.2016.kay at gmail.com>
> À: "Maurizio Cimadamore" <maurizio.cimadamore at oracle.com>
> Cc: "compiler-dev" <compiler-dev at openjdk.java.net>
> Envoyé: Mardi 3 Juillet 2018 04:50:14
> Objet: Re: Generation of NestHost and NestMembers attributes using javac?
> Hi Maurizio,
>
>> JEP 181 was integrated On Sat 23rd of June
> Thank you. I see build 20 (2018/6/29) is now available. I should have
> been patient for one more day ;).
>
> As far as I can determine, a nest member class is always an inner
> class of its nest host class. That is, if there is a NestHost or
> NestMember attribute in a class then there will always also be an
> InnerClasses attribute. Is that indeed the case? If not then do you
> have sample Java source that would result in a NestHost or NestMember
> attribute being generated by javac without an InnerClasses attribute?
>
> Best regards,
> S
More information about the compiler-dev
mailing list