javac is too late detecting invalid annotation usage

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: tools
    • None
    • b113
    • Verified

      Test case:

      class Test<@DA T> { }

      @interface DA { }

      javac rejects it, with
      play/src/Test.java:1: error: annotation type not applicable to this kind of declaration
      class Test<@DA T> { }
                 ^
      1 error


      javadoc accepts it, and generates docs
      build/linux-x86_64-normal-server-release/images/j2sdk-image/bin/javadoc -d play/api -private play/src/Test.java
      Loading source file play/src/Test.java...
      Constructing Javadoc information...
      Standard Doclet version 1.8.0-internal
      Building tree for all the packages and classes...
      Generating play/api/DA.html...
      Generating play/api/Test.html...
      Generating play/api/package-frame.html...
      Generating play/api/package-summary.html...
      Generating play/api/package-tree.html...
      Generating play/api/constant-values.html...
      Building index for all the packages and classes...
      Generating play/api/overview-tree.html...
      Generating play/api/index-all.html...
      Generating play/api/deprecated-list.html...
      Building index for all classes...
      Generating play/api/allclasses-frame.html...
      Generating play/api/allclasses-noframe.html...
      Generating play/api/index.html...
      Generating play/api/help-doc.html...

            Assignee:
            Jan Lahoda
            Reporter:
            Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: