Remove redundant declarations of JSpecify's @⁠NonNull annotation

Closes gh-35341
This commit is contained in:
Sam Brannen 2025-08-19 17:30:47 +02:00
parent bb2a259d85
commit 887ef75700
3 changed files with 8 additions and 12 deletions

View File

@ -20,8 +20,6 @@ import java.beans.BeanInfo;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import org.jspecify.annotations.NonNull;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
/** /**
@ -44,7 +42,7 @@ import org.springframework.core.Ordered;
public class ExtendedBeanInfoFactory extends StandardBeanInfoFactory { public class ExtendedBeanInfoFactory extends StandardBeanInfoFactory {
@Override @Override
public @NonNull BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException { public BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
BeanInfo beanInfo = super.getBeanInfo(beanClass); BeanInfo beanInfo = super.getBeanInfo(beanClass);
return (supports(beanClass) ? new ExtendedBeanInfo(beanInfo) : beanInfo); return (supports(beanClass) ? new ExtendedBeanInfo(beanInfo) : beanInfo);
} }

View File

@ -29,7 +29,6 @@ import java.util.function.Predicate;
import java.util.stream.Stream; import java.util.stream.Stream;
import java.util.stream.StreamSupport; import java.util.stream.StreamSupport;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable; import org.jspecify.annotations.Nullable;
/** /**
@ -483,7 +482,7 @@ final class TypeMappedAnnotations implements MergedAnnotations {
} }
@Override @Override
public @NonNull List<Aggregate> finish(@Nullable List<Aggregate> processResult) { public List<Aggregate> finish(@Nullable List<Aggregate> processResult) {
return this.aggregates; return this.aggregates;
} }
} }

View File

@ -29,7 +29,6 @@ import java.util.Objects;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable; import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -470,13 +469,13 @@ class AnnotationsScannerTests {
new AnnotationsProcessor<Object, String>() { new AnnotationsProcessor<Object, String>() {
@Override @Override
public @NonNull String doWithAggregate(Object context, int aggregateIndex) { public String doWithAggregate(Object context, int aggregateIndex) {
return ""; return "";
} }
@Override @Override
public @NonNull String doWithAnnotations(Object context, int aggregateIndex, public String doWithAnnotations(Object context, int aggregateIndex,
@Nullable Object source, @Nullable Annotation @Nullable [] annotations) { @Nullable Object source, @Nullable Annotation[] annotations) {
throw new IllegalStateException("Should not call"); throw new IllegalStateException("Should not call");
} }
@ -502,13 +501,13 @@ class AnnotationsScannerTests {
new AnnotationsProcessor<Object, String>() { new AnnotationsProcessor<Object, String>() {
@Override @Override
public @NonNull String doWithAnnotations(Object context, int aggregateIndex, public String doWithAnnotations(Object context, int aggregateIndex,
@Nullable Object source, @Nullable Annotation @Nullable [] annotations) { @Nullable Object source, @Nullable Annotation[] annotations) {
return "K"; return "K";
} }
@Override @Override
public @NonNull String finish(@Nullable String result) { public String finish(@Nullable String result) {
return "O" + result; return "O" + result;
} }