JDK-8359493 : Refactor how aggregated mandatory warnings are handled in the compiler
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2025-06-13
  • Updated: 2025-09-19
  • Resolved: 2025-07-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b06Fixed
Related Reports
Relates :  
Description
The compiler's handling of the aggregation of mandatory warnings into "notes" at the end of compilation can be refactored to simplify the code.

The `JCDiagnostic` class supports flags that alter how warnings are handled, e.g., `MANDATORY`, `NON_DEFERRABLE`, etc. So instead of having to log aggregated mandatory warnings through a separate channel (the `MandatoryWarningHandler`), these warnings could instead be logged just like any other warning, but with an `AGGREGATED` flag added. The actual aggregation can then be handled "behind the scenes" by the logging subsystem.

This will also make it easier to implement `@SuppressAnnotations` support for parser/tokenizer warnings which require aggregated mandatory warning notes such as warnings for preview features.

Comments
Changeset: 25ed36f3 Branch: master Author: Archie Cobbs <acobbs@openjdk.org> Date: 2025-07-03 18:13:07 +0000 URL: https://git.openjdk.org/jdk/commit/25ed36f3ef1fe1d6914689c762910f104775f48c
03-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25810 Date: 2025-06-13 21:25:54 +0000
13-06-2025