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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 8
    • Affects Version/s: 8
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: