Enhanced deprecation [JEP-277]
There are two facilities for expressing deprecation:
@Deprecated
annotation@deprecated
javadoc tag
These facilities were introduced in Java SE 5 and JDK 1.1, respectively. The @Deprecated
annotation was intended to annotate program components that should not be used because they were deemed dangerous and/or there was a better option. That was the intended use. Actual use varied including and because warnings were only provided at compile time; there was little reason to ignore the annotated code.
The Enhanced Deprecation JEP-277 was taken on to provide developers with clearer information regarding the intended disposition of the APIs in the specification documentation. Work on this JEP also resulted in a tool for analyzing a program's use of deprecated APIs.
To support this fidelity in information, the following components have been added to the java.lang.Deprecated
annotation type:
forRemoval()
:- Returns Boolean
true
if the API element has been slated for future...
- Returns Boolean