Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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;
Expand All @@ -63,7 +62,6 @@
import java.util.Collection;
import java.util.Map;
import java.util.regex.Pattern;
import javax.inject.Inject;
import org.jspecify.annotations.Nullable;

/** A BugPattern; see the summary. */
Expand Down Expand Up @@ -108,13 +106,6 @@ && isWithinAutoValueBuilder(symbol, state)
(ExpressionTree) state.getPath().getParentPath().getParentPath().getLeaf(),
state)));

private final boolean improvements;

@Inject
RedundantSetterCall(ErrorProneFlags flags) {
this.improvements = flags.getBoolean("RedundantSetterCall:Improvements").orElse(true);
}

@Override
public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) {
if (!TERMINAL_FLUENT_SETTER.matches(tree, state)) {
Expand Down Expand Up @@ -147,7 +138,7 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState
if (methodName.endsWith("Builder")) {
break;
}
if (improvements && isProto && methodName.startsWith("set")) {
if (isProto && methodName.startsWith("set")) {
String withoutSet = methodName.replaceFirst("^set", "");
if (!fieldNames.contains(toUpperCase(withoutSet))) {
if (methodName.endsWith("Value")) {
Expand Down
Loading