From f9865b5717982fb8149a7c6cba316108186b9268 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Mon, 10 Jun 2024 12:37:50 -0700 Subject: [PATCH] Remove temporary `NullablePrimitiveArray` configuration. PiperOrigin-RevId: 641989188 --- .../nullness/NullablePrimitiveArray.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/nullness/NullablePrimitiveArray.java b/core/src/main/java/com/google/errorprone/bugpatterns/nullness/NullablePrimitiveArray.java index 7e03579a61f..ca64e8070ab 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/nullness/NullablePrimitiveArray.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/nullness/NullablePrimitiveArray.java @@ -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; @@ -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; @@ -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); @@ -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();