Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

archiecobbs
Copy link
Contributor

@archiecobbs archiecobbs commented Dec 16, 2024

Please review this fix for an incorrect lint: tag in compiler.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

  • 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

Issue

  • JDK-8346294: Invalid lint category specified in compiler.properties (Bug - P4)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 16, 2024

👋 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 Dec 16, 2024

@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:

8346294: Invalid lint category specified in compiler.properties

Reviewed-by: mcimadamore

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 master branch:

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 16, 2024
@openjdk
Copy link

openjdk bot commented Dec 16, 2024

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

  • build
  • compiler

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.

@openjdk openjdk bot added build build-dev@openjdk.org compiler compiler-dev@openjdk.org labels Dec 16, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 16, 2024

Webrevs

* @return corresponding {@link LintCategory}
* @throws IllegalArgumentException if no such lint category exists
*/
public static LintCategory forOption(String option) {
Copy link
Contributor

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" ?

Copy link
Contributor Author

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.

@mcimadamore
Copy link
Contributor

Thanks for catching this


import com.sun.tools.javac.resources.CompilerProperties.LintWarnings;

public class LintWarningCategoryTest {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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)
Copy link
Contributor

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!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 16, 2024
@archiecobbs
Copy link
Contributor Author

Thanks for the quick review!

@archiecobbs
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 17, 2024

Going to push as commit 87804f2.
Since your change was applied there have been 14 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 17, 2024
@openjdk openjdk bot closed this Dec 17, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 17, 2024
@openjdk
Copy link

openjdk bot commented Dec 17, 2024

@archiecobbs Pushed as commit 87804f2.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org compiler compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants