Blog
Deprecated Annotation
Why didn't Sun add a value property to the @Deprecated annotation so you can describe what to use instead? A look at the annotation and its limitations.
Why didn’t Sun add a value property to the @Deprecated annotation? Instead of
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface Deprecated {
}
which kind of implies we should do the following.
@Deprecated
/** @deprecated use {@link Foo} instead */
public class GoneOff {
// ...
}
why can’t we have
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface MyDeprecated{
public abstract String value() default "";
}
which means we can use
@MyDeprecated("use Foo instead")
public class GoneOff {
// ...
} Discussion