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

unexpected error compiling @Deprecated package

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd_minor
    • Component/s: tools
    • Labels:
      None

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                smarks Stuart Marks
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: