`javac` has long-standing legacy behavior to detect the string `@deprecated` in a documentation comment and then use it to mark the associated declaration as _deprecated_, eventually resulting in a `Deprecated` attribute in the appropriate part of the class file. The behavior predates the availability of annotations in Java source code.
In JDK 1.5, annotations were introduced, including the `@Deprecated` annotation. Nowadays, the recommended usage is to mark the declaration as deprecated using the `@Deprecated` annotation, with adjunct details given in the `@deprecated` block tag in the associated doc comment.
`javac` has also long -provided `-Xlint:dep-ann` to detect and warn about the use of the `@deprecated` block tag in doc comments for declarations that do not have an `@Deprecated` annotation.
The feature is also now "somewhat broken" because `javadoc` will no longer look for block tags within inline tags (which would have been a doc comment syntax error anyway, as an unterminated inline tag.) This change was to allow simple use of annotations in code snippets, removing the interpretation that an annotation may be parsed as a block tag. Fixing this would require something more significant than the current simple lexical check in `JavaTokenizer`. It is better to move towards "requiring" the currently recommended behavior to indicate deprecation with an `@Deprecated` annotation, and to remove the special treatment of the string `@deprecated` within `JavaTokenizer.java`.
In JDK 1.5, annotations were introduced, including the `@Deprecated` annotation. Nowadays, the recommended usage is to mark the declaration as deprecated using the `@Deprecated` annotation, with adjunct details given in the `@deprecated` block tag in the associated doc comment.
`javac` has also long -provided `-Xlint:dep-ann` to detect and warn about the use of the `@deprecated` block tag in doc comments for declarations that do not have an `@Deprecated` annotation.
The feature is also now "somewhat broken" because `javadoc` will no longer look for block tags within inline tags (which would have been a doc comment syntax error anyway, as an unterminated inline tag.) This change was to allow simple use of annotations in code snippets, removing the interpretation that an annotation may be parsed as a block tag. Fixing this would require something more significant than the current simple lexical check in `JavaTokenizer`. It is better to move towards "requiring" the currently recommended behavior to indicate deprecation with an `@Deprecated` annotation, and to remove the special treatment of the string `@deprecated` within `JavaTokenizer.java`.