diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java index 8631fdf73a9e..6e1552aa1c5d 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java @@ -916,7 +916,7 @@ private static T searchWithGetSemantics(AnnotatedElement element, } if (element instanceof Class) { // otherwise getAnnotations doesn't return anything new - Class superclass = ((Class) element).getSuperclass(); + Class superclass = ((Class) element).getSuperclass(); if (superclass != null && superclass != Object.class) { List inheritedAnnotations = new LinkedList<>(); for (Annotation annotation : element.getAnnotations()) {