unexpected error compiling @Deprecated package

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 16
    • Affects Version/s: 9
    • Component/s: tools
    • None
    • b15

      The @Deprecated annotation is supposed to be ignored if it occurs on a package declaration in a package-info.java file. It usually is, unless a javadoc comment with an @deprecated tag also appears on the same package declaration. Consider this package-info.java file:

      ========================================
      /**
       * @deprecated This is a deprecated package.
       */
      @Deprecated
      package com.example.foobar;
      ========================================

      Compiling this results in the following:

      package-info.java:5: error: modifier deprecated not allowed here
      package com.example.foobar;
      ^
      1 error

            Assignee:
            Jan Lahoda
            Reporter:
            Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: