Skip to content

8359493: Refactor how aggregated mandatory warnings are handled in the compiler #25810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

archiecobbs
Copy link
Contributor

@archiecobbs archiecobbs commented Jun 13, 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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issues

  • JDK-8359493: Refactor how aggregated mandatory warnings are handled in the compiler (Sub-task - P4)
  • JDK-8350514: Refactor MandatoryWarningHandler to support dynamic verbosity (Sub-task - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25810/head:pull/25810
$ git checkout pull/25810

Update a local copy of the PR:
$ git checkout pull/25810
$ git pull https://git.openjdk.org/jdk.git pull/25810/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25810

View PR using the GUI difftool:
$ git pr show -t 25810

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25810.diff

Using Webrev

Link to Webrev Comment

@archiecobbs
Copy link
Contributor Author

/issue add JDK-8350514

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 13, 2025

👋 Welcome back acobbs! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 13, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Jun 13, 2025

@archiecobbs
Adding additional issue to issue list: 8350514: Refactor MandatoryWarningHandler to support dynamic verbosity.

@openjdk
Copy link

openjdk bot commented Jun 13, 2025

@archiecobbs The following label will be automatically applied to this pull request:

  • compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@archiecobbs archiecobbs marked this pull request as ready for review June 13, 2025 21:32
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 13, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 13, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant