RFR: 8359493: Refactor how aggregated mandatory warnings are handled in the compiler [v2]

Archie Cobbs acobbs at openjdk.org
Mon Jun 23 15:59:11 UTC 2025


> 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.

Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:

  Apply some review suggestions.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25810/files
  - new: https://git.openjdk.org/jdk/pull/25810/files/75d9edf5..81670b14

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25810&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25810&range=00-01

  Stats: 3 lines in 2 files changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/25810.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25810/head:pull/25810

PR: https://git.openjdk.org/jdk/pull/25810


More information about the compiler-dev mailing list