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

unexpected error compiling @Deprecated package

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 9
    • 16
    • tools
    • None
    • b15

    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

              jlahoda Jan Lahoda
              smarks Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: