Browse Source

Strict nullability for field assignment

pull/26058/head
Juergen Hoeller 5 years ago
parent
commit
bd2640a9d6
  1. 5
      spring-test/src/main/java/org/springframework/test/context/TestContextAnnotationUtils.java

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

@ -492,10 +492,11 @@ public abstract class TestContextAnnotationUtils { @@ -492,10 +492,11 @@ public abstract class TestContextAnnotationUtils {
Assert.notNull(annotation, "Annotation must not be null");
this.rootDeclaringClass = rootDeclaringClass;
this.declaringClass = declaringClass;
this.annotation = (T) AnnotatedElementUtils.findMergedAnnotation(
T mergedAnnotation = (T) AnnotatedElementUtils.findMergedAnnotation(
rootDeclaringClass, annotation.annotationType());
Assert.state(this.annotation != null,
Assert.state(mergedAnnotation != null,
() -> "Failed to find merged annotation for " + annotation);
this.annotation = mergedAnnotation;
}
public Class<?> getRootDeclaringClass() {

Loading…
Cancel
Save