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

Prevent ReverseOrder Refaster rule from introducing a static import #397

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Dec 7, 2022

This is a workaround for google/error-prone#3584.

Suggested commit message:

Prevent `ReverseOrder` Refaster rule from introducing a static import (#397)

This is a workaround for the issue resolved by google/error-prone#3584.

After application of this Refaster rule, any static imports of
`java.util.Collections.reverseOrder` are obsolete. These can be removed by
running Google Java Format or Error Prone's `RemoveUnusedImports` check.

Where possible, subsequent application of the `StaticImport` check will
statically import `java.util.Comparator.reverseOrder`.

@Stephan202 Stephan202 added this to the 0.6.0 milestone Dec 7, 2022
@Stephan202 Stephan202 requested a review from rickie December 7, 2022 17:44
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turn around and fixing this!

W.r.t. suggested commit message made one tweak.

@rickie rickie added the bug Something isn't working label Dec 7, 2022
@Stephan202
Copy link
Member Author

... in that case we need another tweak (applied it).

@rickie
Copy link
Member

rickie commented Dec 7, 2022

@Stephan202 shouldn't it be both "check"?

This is a workaround for the issue resolved by google/error-prone#3584.

After application of this Refaster rule, any static imports of
`java.util.Collections.reverseOrder` are obsolete. These can be removed by
running Google Java Format or Error Prone's `RemoveUnusedImports` check.

Where possible, subsequent application of the `StaticImport` checker will
statically import `java.util.Comparator.reverseOrder`.
@rickie rickie force-pushed the sschroevers/avoid-refaster-static-import-clash branch from 2e411c2 to f9b309f Compare December 7, 2022 18:04
@rickie
Copy link
Member

rickie commented Dec 7, 2022

Rebased.

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Stephan202
Copy link
Member Author

Doh, I misread the diff. I'm fine either way (I also prefer check, but the interface is named BugChecker.) Anyway, fixed.

@rickie rickie merged commit b1c8157 into master Dec 8, 2022
@rickie rickie deleted the sschroevers/avoid-refaster-static-import-clash branch December 8, 2022 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

3 participants