diff --git a/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java b/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java index 8532d26e40e..2a80f47584a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java @@ -20,8 +20,6 @@ import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.lang.reflect.Method; -import org.jspecify.annotations.NonNull; - import org.springframework.core.Ordered; /** @@ -44,7 +42,7 @@ import org.springframework.core.Ordered; public class ExtendedBeanInfoFactory extends StandardBeanInfoFactory { @Override - public @NonNull BeanInfo getBeanInfo(Class beanClass) throws IntrospectionException { + public BeanInfo getBeanInfo(Class beanClass) throws IntrospectionException { BeanInfo beanInfo = super.getBeanInfo(beanClass); return (supports(beanClass) ? new ExtendedBeanInfo(beanInfo) : beanInfo); } diff --git a/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotations.java b/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotations.java index 310348a5cf8..2c20d6766b0 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotations.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotations.java @@ -29,7 +29,6 @@ import java.util.function.Predicate; import java.util.stream.Stream; import java.util.stream.StreamSupport; -import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; /** @@ -483,7 +482,7 @@ final class TypeMappedAnnotations implements MergedAnnotations { } @Override - public @NonNull List finish(@Nullable List processResult) { + public List finish(@Nullable List processResult) { return this.aggregates; } } diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java index 6cb5c2b2248..c1f06239b78 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java @@ -29,7 +29,6 @@ import java.util.Objects; import java.util.function.Predicate; import java.util.stream.Stream; -import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; @@ -470,13 +469,13 @@ class AnnotationsScannerTests { new AnnotationsProcessor() { @Override - public @NonNull String doWithAggregate(Object context, int aggregateIndex) { + public String doWithAggregate(Object context, int aggregateIndex) { return ""; } @Override - public @NonNull String doWithAnnotations(Object context, int aggregateIndex, - @Nullable Object source, @Nullable Annotation @Nullable [] annotations) { + public String doWithAnnotations(Object context, int aggregateIndex, + @Nullable Object source, @Nullable Annotation[] annotations) { throw new IllegalStateException("Should not call"); } @@ -502,13 +501,13 @@ class AnnotationsScannerTests { new AnnotationsProcessor() { @Override - public @NonNull String doWithAnnotations(Object context, int aggregateIndex, - @Nullable Object source, @Nullable Annotation @Nullable [] annotations) { + public String doWithAnnotations(Object context, int aggregateIndex, + @Nullable Object source, @Nullable Annotation[] annotations) { return "K"; } @Override - public @NonNull String finish(@Nullable String result) { + public String finish(@Nullable String result) { return "O" + result; }