A Java compiler must produce a deprecation warning when a type, method, field, or constructor whose declaration is annotated with
@Deprecated
is used (overridden, invoked, or referenced by name) in a construct which is explicitly or implicitly declared, unless:
- The use is within an entity that is itself annotated with the annotation
@Deprecated
; or- The use is within an entity that is annotated to suppress the warning with the annotation
@SuppressWarnings("deprecation")
; or- The use and declaration are both within the same outermost class.
javac
compiles with the JLS but, by default, Eclipse does not. The "Signal overriding or implementing deprecated method" option can be enabled to make it compliant. If possible, we should do that by default in our Eclipse setup.
Comment From: wilkinsona
Configuring it in our Eclipse setup doesn't appear to work as Spring Java Format disables it again.
Comment From: philwebb
See https://github.com/spring-io/spring-javaformat/issues/196
Comment From: wilkinsona
This has been superseded by the changes in Spring Java Format.