Spec updates for getAnnotationsByType and implicit declarations

Alex Buckley alex.buckley at oracle.com
Mon Feb 4 11:58:21 PST 2013


I just updated the PDF with minor corrections related to the changes below.

Notably, container annotations are now "implicitly declared", but only 
implicitly declared formal parameters (not other constructs) must be 
marked by a compiler.

Alex

On 1/31/2013 6:29 PM, Alex Buckley wrote:
> For repeating annotations, I adopted
> get[Declared]AnnotationsByType(Class<T>) in the reflection APIs, and
> clarified the definitions of "directly present" and "present".
>
> For parameter reflection, I did the groundwork for "implicitly declared"
> constructs in the JLS, and clarified that a compiler is to mark
> constructs based on whether they are explicitly or implicitly declared.
> A compiler which emits class files can conform by utilizing the
> ACC_SYNTHETIC and ACC_MANDATED flags described in JVMS 4.7.22. These
> flags defer to a language specification for their full meaning. (It is
> generally better for the JVMS to provide a space which meets the
> requirements of what a compiler would need to represent a language
> construct, than the JLS saving exactly how to map a language construct
> into a class file. Example: the Signature attribute, JVMS 4.7.9.)
>
> The spec is at http://cr.openjdk.java.net/~abuckley/8misc.pdf as usual.
>
> Alex
>
> P.S. There was minor discussion on the GPL'd compiler-dev list about
> naming the ACC_MANDATED flag, starting at
> http://mail.openjdk.java.net/pipermail/compiler-dev/2013-January/005450.html
>



More information about the enhanced-metadata-spec-discuss mailing list