Skip to content

Commit bd2640a

Browse files
committed
Strict nullability for field assignment
1 parent 6825287 commit bd2640a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-test/src/main/java/org/springframework/test/context/TestContextAnnotationUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,11 @@ public static class AnnotationDescriptor<T extends Annotation> {
492492
Assert.notNull(annotation, "Annotation must not be null");
493493
this.rootDeclaringClass = rootDeclaringClass;
494494
this.declaringClass = declaringClass;
495-
this.annotation = (T) AnnotatedElementUtils.findMergedAnnotation(
495+
T mergedAnnotation = (T) AnnotatedElementUtils.findMergedAnnotation(
496496
rootDeclaringClass, annotation.annotationType());
497-
Assert.state(this.annotation != null,
497+
Assert.state(mergedAnnotation != null,
498498
() -> "Failed to find merged annotation for " + annotation);
499+
this.annotation = mergedAnnotation;
499500
}
500501

501502
public Class<?> getRootDeclaringClass() {

0 commit comments

Comments
 (0)