I understand the Java @Deprecated
annotation comes with fields since
and forRemoval
. However, this is not sufficient for developers to switch to the non-deprecated alternative(s) and therefore it is recommended to additionally put a Javadoc with the @deprecated
flag and the link to the new method/class/interface to favor.
Why is the @Deprecated
annotation not already providing such a most relevant field like useInstead
, or inFavorOf
(even allowing multiple values)?
It would definitely ease the transition and foster developers to put in the new methods/classes/interfaces to use instead - currently I have to draw dependency sources to get their Javadocs, and even then often times no alternative to the @deprecated
method/class/interface is mentioned, so that I have to research what the developers of the original code already knew.