Currently sunapi (compiler.warn.sun.proprietary) diagnostics are not emitted if --system is configured to an earlier JDK version, or if -XDignore.symbol.file is configured. Ideally sunapi diagnostics would be reported consistently in both of those configurations.
See test coverage here: https://github.com/openjdk/jdk/blob/1ab1c1d53b86228be85aac96fa5d69db39ac6317/test/langtools/tools/javac/options/system/SystemSunProprietary.java#L94-L100
There are some challenges to doing this, as discussed inJDK-8349058. sunapi are mandatory, unsuppressible warnings, so for compilations using -Werror introducing a sunapi warning that was not shown previously will break the build. Some of the remaining uses of APIs that result in warnings to not have easy migration paths (JDK-8349056). To work around this, -XDignore.symbol.file has become somewhat widely used as an ad-hoc suppression mechanism for sunapi diagnostics.
See test coverage here: https://github.com/openjdk/jdk/blob/1ab1c1d53b86228be85aac96fa5d69db39ac6317/test/langtools/tools/javac/options/system/SystemSunProprietary.java#L94-L100
There are some challenges to doing this, as discussed in
- clones
-
JDK-8332744 [REDO] 'internal proprietary API' diagnostics if --system is configured to an earlier JDK version
-
- Resolved
-
- is blocked by
-
JDK-8349847 Support configuring individual lint categories as errors
-
- Open
-
-
JDK-8349848 Support lint control of sunapi diagnostics
-
- Open
-
- relates to
-
JDK-8349058 'internal proprietary API' warnings make javac warnings unusable
-
- Resolved
-