Uploaded image for project: 'CCC Migration Project'
  1. CCC Migration Project
  2. CCC-6481080

(ann) @Deprecated annotation has no effect on packages

    Details

    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Documenting long-standing behavior.
    • Interface Kind:
      Java API, Language construct
    • Scope:
      SE

      Description

      Summary

      Document in the JLS and libraries specification that a Deprecated annotation does not have an effect on packages.

      Problem

      An @Deprecated annotation can be applied to packages, but has no effect there. (Likewise, an @Deprecated annotation has no effect if applied to a local variable or parameter.)

      Solution

      Update the JLS to state the @Deprecate on a package is a no-op and make analogous changes in the javadoc for java.lang.Deprecated.

      Specification

      JLS 9.6.4.6

      Change

      "Use of the @Deprecated annotation on a local variable declaration or on a parameter declaration has no effect."

      to

      "Use of the @Deprecated annotation on a local variable declaration or on a parameter declaration or on a package declaration has no effect."

      Analogous change in java.lang.Deprecated:

      + * <p> Use of the @Deprecated annotation on a local variable declaration or
      + * on a parameter declaration *or on a package declaration* has no effect.
      + *

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                darcy Joe Darcy
                Reviewed By:
                Alex Buckley
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: