8349847: Support configuring individual lint categories as errors #25558
+162
−56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Note: this is a resubmission of #23622 which was closed accidentally due to a bot bug and which I'm not allowed to reopen.)
This PR refines the
-Werror
flag to support lint categories just like-Xlint
does. So, for example-Werror:all,-preview
would cause an error if any warning other than apreview
warning occurred.A few notes:
Lint
ca[tegory. As always, they cause an error if-Werror
is given, but what if-Werror:all
is given instead? The answer given here is yes, an error will occur.-Werror
works the same way as before, i.e., any warning results in an error. That means if-Werror
is given-Werror:foo
flags have no effect.-Xlint
and-Werror
to utilize the same "parsing" logic. The existing-Xlint
flag has a particular behavior when conflicting flags are combined (e.g.,-Xlint:all -Xlint:none -Xlint:foo -Xlint:-foo
equals-Xlint:all
). This behavior has been preserved and Javadocumented.Progress
Issues
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25558/head:pull/25558
$ git checkout pull/25558
Update a local copy of the PR:
$ git checkout pull/25558
$ git pull https://git.openjdk.org/jdk.git pull/25558/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25558
View PR using the GUI difftool:
$ git pr show -t 25558
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25558.diff
Using Webrev
Link to Webrev Comment