35 lines
832 B
Plaintext
35 lines
832 B
Plaintext
== Why is this an issue?
|
|
|
|
Since Java 9, ``++@Deprecated++`` has two additional arguments to the annotation:
|
|
|
|
* ``++since++`` allows you to describe when the deprecation took place
|
|
* ``++forRemoval++``, indicates whether the deprecated element will be removed at some future date
|
|
|
|
In order to ease the maintainers work, it is recommended to always add one or both of these arguments.
|
|
|
|
This rule reports an issue when ``++@Deprecated++`` is used without any argument.
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,java]
|
|
----
|
|
@Deprecated
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,java]
|
|
----
|
|
@Deprecated(since="4.2", forRemoval=true)
|
|
----
|
|
|
|
=== Exceptions
|
|
|
|
The members and methods of a deprecated class or interface are ignored by this rule. The classes and interfaces themselves are still subject to it.
|
|
|
|
== Resources
|
|
|
|
=== Related rules
|
|
|
|
* S1123
|