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

remove special treatment of `@deprecated` in the javac lexer

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 21
    • tools
    • None

      javac still detects and treats specially the character string `@deprecated` in a documentation comment: in particular, it sets the DEPRECATED flag for the declaration.

      This is archaic behavior from before annotations (and `@Deprecated`) were added in JDK 1.5.

      For a long time now, standard practice has been to use the `@Deprecated` annotation to indicate deprecation, with the `@deprecated` tag used to provide descriptive information about why the declaration is deprecated.

      The detection of the `@deprecated` string effectively became broken when we changed the doc comment parser to ignore potential block tags (like `@deprecated`) when they appear in an inline tag.

      It is time to remove this legacy treatment of the "@deprecated" string in a doc comment ... i.e. detecting the string and marking the declaration as DEPRECATED even if the @Deprecated annotation is not present.

      Separately, we already give a warning if the tag is found but the annotation is not found.The implementation of that warning may need to change and become a doclint or javadoc-only warning.

            nbenalla Nizar Benalla
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: