-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8346294: Invalid lint category specified in compiler.properties #22769
Conversation
👋 Welcome back acobbs! A progress list of the required criteria for merging this PR into |
@archiecobbs This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 14 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@archiecobbs The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
* @return corresponding {@link LintCategory} | ||
* @throws IllegalArgumentException if no such lint category exists | ||
*/ | ||
public static LintCategory forOption(String option) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should call this "getOrThrow" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, or perhaps the most modern & proper thing to do would be to have LintCategory.get()
return Optional<LintCategory>
.
This method is only used in a couple of places so that refactoring seems safe.
Updated in 3f792a8.
Thanks for catching this |
|
||
import com.sun.tools.javac.resources.CompilerProperties.LintWarnings; | ||
|
||
public class LintWarningCategoryTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this specific test? Or will either the build, or other tests fail in case there's a lint category/name mismatch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't strictly need this test, because build will fail now if any lint:
label is invalid, so the test is redundant.
But I also wasn't sure if it was OK to not have any test at all.
Another option would be to split this change two separate bugs/PRs, but that seems like overkill.
(flips through OpenJDK developer guide...) Maybe the best answer would to remove the test and add the noreg-build
label, as this can be considered a build fix.
Let's try that route... updated in 3f792a8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it's ok not to have a test, but you need some keyword, which you added.
LintCategory lc = LintCategory.get((String) (value.value)); | ||
if (lc != null) | ||
suppress(lc); | ||
LintCategory.get((String)value.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think use of Optional
makes sense here too, so bonus point for the extra consolidation!
Thanks for the quick review! |
/integrate |
Going to push as commit 87804f2.
Your commit was automatically rebased without conflicts. |
@archiecobbs Pushed as commit 87804f2. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this fix for an incorrect
lint:
tag incompiler.properties
, plus an adjustment to the build process to automatically detect and fail the build in case of any similar typos in the future.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22769/head:pull/22769
$ git checkout pull/22769
Update a local copy of the PR:
$ git checkout pull/22769
$ git pull https://git.openjdk.org/jdk.git pull/22769/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22769
View PR using the GUI difftool:
$ git pr show -t 22769
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22769.diff
Using Webrev
Link to Webrev Comment