JDK 9 RFR of 6481080 : (ann) @Deprecated annotation has no effect on packages
joe.darcy at oracle.com
Wed Jan 7 21:16:44 UTC 2015
On 1/7/2015 1:44 AM, Paul Sandoz wrote:
> On Jan 7, 2015, at 12:12 AM, joe darcy <joe.darcy at oracle.com> wrote:
>> As part of cleaning up the deprecation facility in 9, please review this change to document when a @Deprecated annotation is a no-op:
>> 6481080 : (ann) @Deprecated annotation has no effect on packages
> I am curious to know why @Deprecated was originally allowed to be declared on local variables and packages if it has no effect. I can imagine for the latter there might be some computational issue with javac and I suppose there is still some source code documentation value and other tools can still crunch on it.
Back in JDK 5 when annotations were added, the Deprecated annotation
type was initially unconstrained in what it could be applied to (no
@Target meta-annotation) . I believe this was just a small oversight
in part of the libraries work in 5.
A target list was added in 7 as an outgrowth of the JDK 308 work (to
make sure Deprecated wasn't a TYPE_USE).  For compatibility, the
target list included all the JDK 5-era values. 
More information about the core-libs-dev