RFR: 8349848: Support lint control of sunapi diagnostics
Benoit Daloze
duke at openjdk.org
Mon Feb 17 12:59:22 UTC 2025
On Fri, 14 Feb 2025 21:07:36 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> This PR creates a new lint category `proprietary` that controls the mandatory warning "Foo is internal proprietary API and may be removed in a future release".
>
> This allows developers to suppress this warning using `-Xlint:-proprietary` and/or `@SuppressWarnings`.
Note this comes relates to https://bugs.openjdk.org/browse/JDK-8349056 and comes from https://bugs.openjdk.org/browse/JDK-8349058
So it's notably about sun.misc.Signal, which has no replacement available (https://bugs.openjdk.org/browse/JDK-8087286).
Given the replies on that issue it may takes years until a replacement is available.
JEP 498 only covers Unsafe.
(BTW Unsafe already has separate deprecation & runtime warnings, the sun API warnings for Unsafe are at this point more noise & confusing than helpful.)
> The APIs in the jdk.unsupported module, otherwise known as the "critical internal APIs" (see JEP 260), have no future.
No future but no replacement planned yet seems contradictory to me.
`-XDignore.symbol.file` is not a good workaround, it has many undesirable side effects besides suppressing the sun API warnings (e.g. not using the symbol file and so missing the code is using methods not available in the target JDK).
It's also brittle as JDK-8331081 has been needed to be redone twice already due to this.
I think this change makes a lot of sense, in fact every warning system should always have a way to suppress warnings, and if it has categories then every warning should fall into some category.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23650#issuecomment-2663044278
More information about the compiler-dev
mailing list