RFR: 8349848: Support lint control of sunapi diagnostics

Alan Bateman alanb at openjdk.org
Mon Feb 17 09:58:10 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`.

@archiecobbs I think it's a bit premature to create a PR for this as it sends a confusing message to developers about the future of these APIs. The APIs in the jdk.unsupported module, otherwise known as the "critical internal APIs" (see JEP 260), have no future. It's a feature that javac generates a warning that can't be suppressed with `@SuppressWarnings` when compiling code that uses classes in this module. The roadmap to remove these classes has now progressed to a warning at runtime (see JEP 498). A future JEP will remove the ability to suppress the warning at runtime.  The long standing (undocumented) workaround to use `-XDignore.symbol.file` when compiling with `-Werror` requires a nose peg but I think we are stuck with it, and the status quo, until jdk.unsupported module is removed.

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

PR Comment: https://git.openjdk.org/jdk/pull/23650#issuecomment-2662598684


More information about the compiler-dev mailing list