@Deprecated
should not be applied to local variables or parameters JAVA-W1082Avoid marking parameters or local variables as @Deprecated
, as the annotation will have no effect.
In the method below, the argument input
is marked with @Deprecated
. However, this annotation will have no semantic meaning, and javac
will not generate a deprecation warning for it like it would for usage of a method annotated with @Deprecated
.
public static String getSomething(@Deprecated String input) {
// ...
}
Avoid marking parameters and local variables as @Deprecated
.