There used to be an internal flag '-XDenableSunApiLintControl' to enable using -Xlint to control them, but it was removed as part of a cleanup of 'unused options' in JDK-8148808.
This enhancement proposes restoring the ability to control sunapi as a lint category, including with -Xlint: and @SuppressWarnings.
Making sunapi mandatory and unsuppressible may have been a deliberate choice to encourage users to migrate off the deprecated APIs instead of suppressing. (I don't know the history of that decision orJDK-8148808, clarifications on that are welcome.) However in practice, due to bug JDK-8349846 sunapi diagnostics can be suppressed by passing -XDignore.symbol.file or some values of --system, so there is a suppression mechanism, it's just an ad-hoc one.
Providing a way to suppress sunapi with -Xlint:-sunapi or @SuppressWarnings would provide a path to fixing JDK-8349846.
This enhancement proposes restoring the ability to control sunapi as a lint category, including with -Xlint: and @SuppressWarnings.
Making sunapi mandatory and unsuppressible may have been a deliberate choice to encourage users to migrate off the deprecated APIs instead of suppressing. (I don't know the history of that decision or
Providing a way to suppress sunapi with -Xlint:-sunapi or @SuppressWarnings would provide a path to fixing JDK-8349846.
- blocks
-
JDK-8349846 [REDO] [REDO] 'internal proprietary API' diagnostics if --system is configured to an earlier JDK version
-
- Open
-
- csr for
-
JDK-8350135 Support lint control of sunapi diagnostics
-
- Closed
-
- relates to
-
JDK-8148808 javac, remove unused options, step 1
-
- Closed
-
-
JDK-8349058 'internal proprietary API' warnings make javac warnings unusable
-
- Resolved
-
- links to
-
Review(master) openjdk/jdk/23650