Skip to content

Commit 82b4f96

Browse files
graememorganError Prone Team
authored andcommitted
Remove matchLiteProtos from RedundantSetterCall.
PiperOrigin-RevId: 830352670
1 parent 0d4cf65 commit 82b4f96

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

core/src/main/java/com/google/errorprone/bugpatterns/RedundantSetterCall.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,10 @@ && isWithinAutoValueBuilder(symbol, state)
110110
state)));
111111

112112
private final boolean improvements;
113-
private final boolean matchLiteProtos;
114113

115114
@Inject
116115
RedundantSetterCall(ErrorProneFlags flags) {
117116
this.improvements = flags.getBoolean("RedundantSetterCall:Improvements").orElse(true);
118-
this.matchLiteProtos = flags.getBoolean("OneOfChecks:MatchLiteProtos").orElse(true);
119117
}
120118

121119
@Override
@@ -187,9 +185,6 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState
187185
}
188186

189187
private ImmutableMap<String, OneOfField> scanForOneOfSetters(Symbol proto, VisitorState state) {
190-
if (!matchLiteProtos && isSubtype(proto.type, GENERATED_MESSAGE_LITE.get(state), state)) {
191-
return ImmutableMap.of();
192-
}
193188
var builder = ImmutableMap.<String, OneOfField>builder();
194189
for (Symbol element : getEnclosedElements(proto)) {
195190
if (!ONE_OF_ENUM.apply(element.type, state)) {
@@ -221,9 +216,6 @@ private static ImmutableSet<String> getFields(Symbol proto) {
221216
.collect(toImmutableSet());
222217
}
223218

224-
private static final Supplier<Type> GENERATED_MESSAGE_LITE =
225-
memoize(state -> state.getTypeFromString("com.google.protobuf.GeneratedMessageLite"));
226-
227219
private static final Supplier<Type> MESSAGE_LITE =
228220
memoize(state -> state.getTypeFromString("com.google.protobuf.MessageLite"));
229221

0 commit comments

Comments
 (0)