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

Peter Levart peter.levart at gmail.com
Wed May 11 16:17:42 UTC 2016


Hi Martin,


On 05/11/2016 05:59 PM, Martin Buchholz wrote:
> 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.

I don't think you are making sense. Are you saying that the library 
maintainer will not the be only person that will be compiling library 
sources to produce binary artifacts? That one guy may want to compile 
the library sources on the JDK 6 platform and some other guy may want to 
compile the same sources on the JDK 9 platform?

Regards, Peter




More information about the core-libs-dev mailing list