Skip to content

Commit

Permalink
Strict nullability for field assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Nov 9, 2020
1 parent 6825287 commit bd2640a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,11 @@ public static class AnnotationDescriptor<T extends Annotation> {
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() {
Expand Down

0 comments on commit bd2640a

Please sign in to comment.