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

Repeating annotations: No Target on base with two new targets on container compiles unexepectedly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8
    • tools
    • b84
    • Verified

      If base annotation is not meta-annotated with @Target, the compiler assumes that it has the JDK7 targets by default.

      If container annotation is now meta-annotated with @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) which are the new targets added in JDK8, the test code compiles unexpectedly.

      Expected behavior: TYPE_USE and TYPE_PARAMETER are not default targets, so target set for container annotation is not a subset of target set for base and compilation should fail.
      Test code attached.

            jfranck Joel Borggrén-Franck (Inactive)
            sogoel Sonali Goel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: