RFR(m): 8140281 deprecate Optional.get()

Martin Buchholz martinrb at google.com
Wed May 11 15:59:43 UTC 2016


On Wed, May 11, 2016 at 12:05 AM, Peter Levart <peter.levart at gmail.com> wrote:
> Couldn't this new @Deprecated.since annotation attribute play a role here?
> For example, if you are building with JDK 9 javac, but specify -release 8
> option, then you don't get deprecation warning for methods annotated with
> @Deprecated(since = "9").

It helps, but ... the library maintainer and the invoker of javac are
not the same, so a conscientious (and omniscient and indefatigable)
library maintainer will still add @SuppressWarnings to their jdk6+
library the day it is @Deprecated in jdk9.

We could add something like @TargetedRelease, which java has
historically been reluctant to do.
Compare with API conformance macros in C
#define _XOPEN_SOURCE 500
placed at the top of every source file.



More information about the core-libs-dev mailing list