From 3e4aa1dbbf554ebb517233677ad63c512878a332 Mon Sep 17 00:00:00 2001 From: ghm Date: Wed, 19 Jun 2024 05:07:41 -0700 Subject: [PATCH] Hack out `RedundantSetterCall:MatchOneOfs` flag; it's now enabled. PiperOrigin-RevId: 644712978 --- .../errorprone/bugpatterns/RedundantSetterCall.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/RedundantSetterCall.java b/core/src/main/java/com/google/errorprone/bugpatterns/RedundantSetterCall.java index ddd4f5d07a3..4b08e933309 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/RedundantSetterCall.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/RedundantSetterCall.java @@ -43,7 +43,6 @@ import com.google.common.collect.ListMultimap; import com.google.errorprone.BugPattern; import com.google.errorprone.BugPattern.StandardTags; -import com.google.errorprone.ErrorProneFlags; import com.google.errorprone.VisitorState; import com.google.errorprone.bugpatterns.BugChecker.MethodInvocationTreeMatcher; import com.google.errorprone.fixes.SuggestedFix; @@ -106,12 +105,8 @@ && isWithinAutoValueBuilder(symbol, state) (ExpressionTree) state.getPath().getParentPath().getParentPath().getLeaf(), state))); - private final boolean matchOneOfs; - @Inject - RedundantSetterCall(ErrorProneFlags flags) { - this.matchOneOfs = flags.getBoolean("RedundantSetterCall:MatchOneOfs").orElse(true); - } + RedundantSetterCall() {} @Override public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { @@ -119,8 +114,7 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState return Description.NO_MATCH; } ListMultimap setters = ArrayListMultimap.create(); - ImmutableMap oneOfSetters = - matchOneOfs ? scanForOneOfSetters(getType(tree), state) : ImmutableMap.of(); + ImmutableMap oneOfSetters = scanForOneOfSetters(getType(tree), state); Type type = ASTHelpers.getReturnType(tree); for (ExpressionTree current = tree; FLUENT_SETTER.matches(current, state);