Integrated: 8259039: Passing different version to --release flag than javac version output warning

Jan Lahoda jlahoda at openjdk.java.net
Mon Sep 20 13:48:15 UTC 2021


On Mon, 9 Aug 2021 13:33:06 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> For code like:
> 
> com.sun.nio.file.ExtendedOpenOption o;
> 
> 
> certain combination of command line options produce a proprietary warnings:
> 
> $ javac --release 11 T.java 
> T.java:2: warning: ExtendedOpenOption is internal proprietary API and may be removed in a future release
>     com.sun.nio.file.ExtendedOpenOption o;
>                     ^
> 1 warning
> 
> 
> But some do not:
> 
> $ javac -source 8 T.java 
> warning: [options] bootstrap class path not set in conjunction with -source 8
> 1 warning
> 
> 
> The reason is that the `ct.properties` files does not mark `com.sun.nio.file` as proprietary. The proposed fix has two parts:
> -adds `proprietary` to the `com.sun.nio.file` package in `ct.properties`
> -limits the `ct.properties` so that it is only used for `-source 8`. The `ct.properties` contains 3 types of information: it hides some packages, it marks some packages as "proprietary" (so that they produce the warning), and assigns packages to compact profiles. For `-source 9+`, most of these is not needed - packages are hidden using the module system, the only packages that need a warning are from the `jdk.unsupported` module, and there are no compact profiles. So for `-source 9+`, we don't need to use the `ct.properties`. (Note none of this applies to `--release` - it uses a different database.)

This pull request has now been integrated.

Changeset: 699865f7
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/699865f76cdf76fbd8042c1b5677b71e29faa4bc
Stats:     162 lines in 4 files changed: 152 ins; 4 del; 6 mod

8259039: Passing different version to --release flag than javac version output warning

Reviewed-by: jjg

-------------

PR: https://git.openjdk.java.net/jdk/pull/5053


More information about the compiler-dev mailing list