Skip to content

Commit f4bd0e5

Browse files
sbrannenasifebrahim
authored andcommitted
Remove redundant declarations of JSpecify's @⁠NonNull annotation
Closes gh-35341
1 parent d84ee46 commit f4bd0e5

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfoFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import java.beans.IntrospectionException;
2121
import java.lang.reflect.Method;
2222

23-
import org.jspecify.annotations.NonNull;
24-
2523
import org.springframework.core.Ordered;
2624

2725
/**
@@ -44,7 +42,7 @@
4442
public class ExtendedBeanInfoFactory extends StandardBeanInfoFactory {
4543

4644
@Override
47-
public @NonNull BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
45+
public BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException {
4846
BeanInfo beanInfo = super.getBeanInfo(beanClass);
4947
return (supports(beanClass) ? new ExtendedBeanInfo(beanInfo) : beanInfo);
5048
}

spring-core/src/main/java/org/springframework/core/annotation/TypeMappedAnnotations.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.stream.Stream;
3030
import java.util.stream.StreamSupport;
3131

32-
import org.jspecify.annotations.NonNull;
3332
import org.jspecify.annotations.Nullable;
3433

3534
/**
@@ -483,7 +482,7 @@ private void addAggregateAnnotations(List<Annotation> aggregateAnnotations, @Nul
483482
}
484483

485484
@Override
486-
public @NonNull List<Aggregate> finish(@Nullable List<Aggregate> processResult) {
485+
public List<Aggregate> finish(@Nullable List<Aggregate> processResult) {
487486
return this.aggregates;
488487
}
489488
}

spring-core/src/test/java/org/springframework/core/annotation/AnnotationsScannerTests.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.function.Predicate;
3030
import java.util.stream.Stream;
3131

32-
import org.jspecify.annotations.NonNull;
3332
import org.jspecify.annotations.Nullable;
3433
import org.junit.jupiter.api.Test;
3534

@@ -470,13 +469,13 @@ void scanWhenProcessorReturnsFromDoWithAggregateExitsEarly() {
470469
new AnnotationsProcessor<Object, String>() {
471470

472471
@Override
473-
public @NonNull String doWithAggregate(Object context, int aggregateIndex) {
472+
public String doWithAggregate(Object context, int aggregateIndex) {
474473
return "";
475474
}
476475

477476
@Override
478-
public @NonNull String doWithAnnotations(Object context, int aggregateIndex,
479-
@Nullable Object source, @Nullable Annotation @Nullable [] annotations) {
477+
public String doWithAnnotations(Object context, int aggregateIndex,
478+
@Nullable Object source, @Nullable Annotation[] annotations) {
480479
throw new IllegalStateException("Should not call");
481480
}
482481

@@ -502,13 +501,13 @@ void scanWhenProcessorHasFinishMethodUsesFinishResult() {
502501
new AnnotationsProcessor<Object, String>() {
503502

504503
@Override
505-
public @NonNull String doWithAnnotations(Object context, int aggregateIndex,
506-
@Nullable Object source, @Nullable Annotation @Nullable [] annotations) {
504+
public String doWithAnnotations(Object context, int aggregateIndex,
505+
@Nullable Object source, @Nullable Annotation[] annotations) {
507506
return "K";
508507
}
509508

510509
@Override
511-
public @NonNull String finish(@Nullable String result) {
510+
public String finish(@Nullable String result) {
512511
return "O" + result;
513512
}
514513

0 commit comments

Comments
 (0)