RFR: 8145461 changes to @Deprecated annotation

Stephen Colebourne scolebourne at joda.org
Tue Mar 29 22:54:29 UTC 2016


I am pleased to see the simpler form of the API move forward.

However, I feel that condemed() as a boolean does not provide the key
piece of information necessary - the expected version of removal. I
would counter-propose that condemed() be replaced by
expectedDeletion(), a String with the same version semantics as
since(). While occasionally, the deletion version will be wrong or
need to be pushed back, in most cases it will be correct. What it does
do is provides a much better sense to users as to what is going to
happen.

@Deprecated(since="9", expectedDeletion="11)
public void myBadBadMethod() {...}

Stephen



On 29 March 2016 at 23:38, Stuart Marks <stuart.marks at oracle.com> wrote:
> Hi all,
>
> Please review these changes to the @Deprecated annotation:
>
>     http://cr.openjdk.java.net/~smarks/reviews/8145461/webrev.0/
>
> This is the first of a set of changes for JEP 277, which I hope will become
> Targeted to JDK 9 late this week. Changes to the deprecation status of
> specific APIs will be in subsequent changesets, along with some deprecation
> tooling.
>
> Note that this is considerably simplified from previous drafts. In
> particular, there is no "reason" enum. See the JEP [1] for background and
> rationale.
>
> Thanks,
>
> s'marks
>
> [1] http://openjdk.java.net/jeps/277
>


More information about the jdk9-dev mailing list