Strict nullability for field assignment

This commit is contained in:
Juergen Hoeller 2020-11-09 21:33:32 +01:00
parent 6825287360
commit bd2640a9d6
1 changed files with 3 additions and 2 deletions

View File

@ -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() {