-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8348611: Eliminate DeferredLintHandler and emit warnings after attribution #24584
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back acobbs! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@archiecobbs this pull request can not be integrated into git checkout JDK-8348611
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
/issue remove JDK-8350514 |
@archiecobbs |
…t a dependency.
The extra checks for "-Xlint:none" are needed now because of JDK-8352612, which changed the behavior of "-Xlint:none" to no longer imply "-nowarn", which allowed the affected warnings to get away with skipping that check.
This is a cleanup/refactoring of how lint warnings are logged and
@SuppressWarnings
annotations applied.A central challenge with lint warnings is that warnings can be generated during any compiler phase, but whether a particular lint warning is suppressed via
@SuppressWarnings
can't be known until after attribution. For example, the parser doesn't have enough information to interpret and apply@SuppressWarnings("text-blocks")
to text blocks, or@SuppressWarnings("preview")
to preview lexical features; instead, theDeferredLintHandler
is used to workaround this limitation.In addition, several other factors complicate things:
Lint
instance requires manually tracking it with each declaration visited and applying/removing the@SuppressWarnings
annotation there, if any@SuppressWarnings
, while others are only suppressible via-Xlint:-foo
flagsDeferredLintHandler
because even after speculation is complete, we may still not yet know whether a warning should be suppressed.Previously the logic to get all of this right was non-obviously woven around the code base. In particular, you needed to know somehow whether or not to use
DeferredLintHandler
, and in what "mode".The overall goal of this PR is to simplify usage so that no matter where you are in the compiler, you can just invoke
log.warning()
to log a warning and (mostly) forget about all of the details listed above.Progress
Issues
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24584/head:pull/24584
$ git checkout pull/24584
Update a local copy of the PR:
$ git checkout pull/24584
$ git pull https://git.openjdk.org/jdk.git pull/24584/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24584
View PR using the GUI difftool:
$ git pr show -t 24584
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24584.diff
Using Webrev
Link to Webrev Comment