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

unexpected error compiling @Deprecated package

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 16
    • 9
    • 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

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

              Created:
              Updated:
              Resolved: