Skip to content

Commit

Permalink
Remove temporary NullablePrimitiveArray configuration.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 641989188
  • Loading branch information
cpovirk authored and Error Prone Team committed Jun 14, 2024
1 parent 04c76af commit f9865b5
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.google.common.collect.ImmutableList;
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;
import com.google.errorprone.bugpatterns.BugChecker.MethodTreeMatcher;
Expand All @@ -48,7 +47,6 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
import javax.inject.Inject;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeKind;
Expand All @@ -63,14 +61,6 @@
tags = StandardTags.STYLE)
public class NullablePrimitiveArray extends BugChecker
implements VariableTreeMatcher, MethodTreeMatcher {
private final boolean fixEvenWhenMixedWithDeclaration;

@Inject
NullablePrimitiveArray(ErrorProneFlags flags) {
this.fixEvenWhenMixedWithDeclaration =
flags.getBoolean("NullablePrimitiveArray:FixEvenWhenMixedWithDeclaration").orElse(true);
}

@Override
public Description matchMethod(MethodTree tree, VisitorState state) {
return check(tree.getReturnType(), tree.getModifiers().getAnnotations(), state);
Expand Down Expand Up @@ -110,11 +100,6 @@ private Description check(
if (typeNullnessAnnos.isEmpty()) {
return NO_MATCH;
}
if (!fixEvenWhenMixedWithDeclaration
&& allTreeAnnos.stream()
.anyMatch(annotation -> !isTypeAnnotation(getSymbol(annotation).attribute(target)))) {
return NO_MATCH;
}
Tree dims = typeTree;
while (dims instanceof ArrayTypeTree) {
dims = ((ArrayTypeTree) dims).getType();
Expand Down

0 comments on commit f9865b5

Please sign in to comment.