Skip to content

Commit

Permalink
Disallow static import of `BugCheckerRefasctoringTestHelper.TestMode#…
Browse files Browse the repository at this point in the history
…TEXT_MATCH`
  • Loading branch information
rickie committed Oct 26, 2023
1 parent a435b65 commit d1b7d45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
.putAll(
"java.util.Collections",
"addAll",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static com.google.common.collect.ImmutableListMultimap.toImmutableListMultimap;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet;
import static com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode.TEXT_MATCH;
import static com.google.errorprone.BugPattern.SeverityLevel.ERROR;
import static java.util.Comparator.naturalOrder;
import static tech.picnic.errorprone.refaster.runner.Refaster.INCLUDED_RULES_PATTERN_FLAG;
Expand All @@ -19,6 +18,7 @@
import com.google.common.collect.Range;
import com.google.common.collect.Sets;
import com.google.errorprone.BugCheckerRefactoringTestHelper;
import com.google.errorprone.BugCheckerRefactoringTestHelper.TestMode;
import com.google.errorprone.BugPattern;
import com.google.errorprone.ErrorProneFlags;
import com.google.errorprone.SubContext;
Expand Down Expand Up @@ -126,7 +126,7 @@ public static void validate(Class<?> clazz) {
.setArgs(ImmutableList.of("-XepOpt:" + RULE_COLLECTION_FLAG + '=' + className))
.addInput(className + "TestInput.java")
.addOutput(className + "TestOutput.java")
.doTest(TEXT_MATCH);
.doTest(TestMode.TEXT_MATCH);

Check warning on line 129 in refaster-test-support/src/main/java/tech/picnic/errorprone/refaster/test/RefasterRuleCollection.java

View workflow job for this annotation

GitHub Actions / pitest

A change can be made to line 129 without causing a test to fail

removed call to com/google/errorprone/BugCheckerRefactoringTestHelper::doTest (covered by 7 tests VoidMethodCallMutator)
}

@Override
Expand Down

0 comments on commit d1b7d45

Please sign in to comment.