Skip to content

Commit

Permalink
Remove the FlagMoreCases flag.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 570082434
  • Loading branch information
graememorgan authored and Error Prone Team committed Oct 3, 2023
1 parent e8f3d64 commit fb6b17b
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

import com.google.common.collect.Streams;
import com.google.errorprone.BugPattern;
import com.google.errorprone.ErrorProneFlags;
import com.google.errorprone.VisitorState;
import com.google.errorprone.bugpatterns.BugChecker;
import com.google.errorprone.bugpatterns.BugChecker.MethodInvocationTreeMatcher;
Expand Down Expand Up @@ -155,13 +154,10 @@ public class TruthIncompatibleType extends BugChecker implements MethodInvocatio
typeFromString("com.google.common.truth.Correspondence");

private final TypeCompatibility typeCompatibility;
private final boolean flagMoreCases;

@Inject
TruthIncompatibleType(TypeCompatibility typeCompatibility, ErrorProneFlags flags) {
TruthIncompatibleType(TypeCompatibility typeCompatibility) {
this.typeCompatibility = typeCompatibility;

this.flagMoreCases = flags.getBoolean("TruthIncompatibleType:FlagMoreCases").orElse(true);
}

@Override
Expand Down Expand Up @@ -210,7 +206,7 @@ private Stream<Description> matchEquality(MethodInvocationTree tree, VisitorStat
}

private Stream<Description> matchIsAnyOf(MethodInvocationTree tree, VisitorState state) {
if (!flagMoreCases || !IS_ANY_OF.matches(tree, state)) {
if (!IS_ANY_OF.matches(tree, state)) {
return Stream.empty();
}
ExpressionTree receiver = getReceiver(tree);
Expand All @@ -223,7 +219,7 @@ private Stream<Description> matchIsAnyOf(MethodInvocationTree tree, VisitorState
}

private Stream<Description> matchIsIn(MethodInvocationTree tree, VisitorState state) {
if (!flagMoreCases || !IS_IN.matches(tree, state)) {
if (!IS_IN.matches(tree, state)) {
return Stream.empty();
}
ExpressionTree receiver = getReceiver(tree);
Expand Down

0 comments on commit fb6b17b

Please sign in to comment.