Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8145032

9.7.4: Clarify when a type annotation serves as a declaration annotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8
    • specification

      See http://mail.openjdk.java.net/pipermail/compiler-dev/2015-December/009875.html. In summary: consider an annotation type T that is applicable in type contexts only, and suppose that an annotation @T is applied to a class declaration or a type parameter declaration; @T should be classified as a declaration annotation not a type annotation. 9.7.4 should add a paragraph:

      ---
      A declaration annotation is ...
      ***Additionally, a declaration annotation is an annotation that applies to either:
      - a class, interface, enum, or annotation type declaration, or
      - a type parameter declaration of a generic class, interface, method, or
      constructor
      and whose own type is applicable in type contexts.***
      ---

            abuckley Alex Buckley
            abuckley Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: