JDK-8361401 : Warnings for use of Sun APIs should not be mandatory
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 26
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-07-04
  • Updated: 2025-07-04
Related Reports
CSR :  
Relates :  
Description
An old fix:

https://github.com/openjdk/jdk/commit/21312c5617160ee294acedd0636e3e52d607fce8

Caused Sun API warnings to be emitted using `Log::mandatoryWarning`. This was done to make sure that all warnings went through `Log::report`, while ensuring that such warnings could not be suppressed e.g. with `nowarn`.

Unfortunately this change also resulted in upgrading these warnings to the status of "mandatory warning" -- meaning a warning that is mandated by the JLS -- which is clearly not the case here. This bad status can be seen when interacting with diagnostic objects using the compiler API.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26129 Date: 2025-07-04 10:57:39 +0000
04-07-2025