-
Notifications
You must be signed in to change notification settings - Fork 39
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
Disallow static import of BugCheckerRefasctoringTestHelper.TestMode#TEXT_MATCH
#862
Conversation
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
d1b7d45
to
50d6342
Compare
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.
Rebased and added a commit. Suggested commit message:
Disallow static import of `BugCheckerRefasctoringTestHelper.TestMode` members (#862)
@@ -78,6 +78,7 @@ public final class NonStaticImport extends BugChecker implements CompilationUnit | |||
static final ImmutableSetMultimap<String, String> NON_STATIC_IMPORT_CANDIDATE_MEMBERS = | |||
ImmutableSetMultimap.<String, String>builder() | |||
.put("com.google.common.base.Predicates", "contains") | |||
.put("com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode", "TEXT_MATCH") |
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.
It's not like we do want to statically import AST_MATCH
, so I suppose we can extend NON_STATIC_IMPORT_CANDIDATE_TYPES
instead.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
50d6342
to
f2a09ed
Compare
Kudos, SonarCloud Quality Gate passed! |
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed. |
I remembered we wanted to fix this one some time ago.
However, it does a non 100% optimal fix for this specific case as it rewrites it to:
Which can be easily fixed by removing the qualifier, but I'd say flagging this is an improvement for now.
Didn't add a test as we already extensively test the members in the
identification
test.Suggested commit message: