From d4e34d1f27954bcdcfcde551362372ac82c550a7 Mon Sep 17 00:00:00 2001 From: ghm Date: Tue, 3 Oct 2023 02:33:25 -0700 Subject: [PATCH] Remove the FlagMoreCases flag. PiperOrigin-RevId: 570322775 --- .../TruthIncompatibleType.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/collectionincompatibletype/TruthIncompatibleType.java b/core/src/main/java/com/google/errorprone/bugpatterns/collectionincompatibletype/TruthIncompatibleType.java index 060d1448b48..56bc11e9d7a 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/collectionincompatibletype/TruthIncompatibleType.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/collectionincompatibletype/TruthIncompatibleType.java @@ -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; @@ -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 @@ -210,7 +206,7 @@ private Stream matchEquality(MethodInvocationTree tree, VisitorStat } private Stream 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); @@ -223,7 +219,7 @@ private Stream matchIsAnyOf(MethodInvocationTree tree, VisitorState } private Stream 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);