diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java index 64aa0a2f263..cb78bf95c7b 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java @@ -192,7 +192,7 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator { * @return whether the annotation qualifies as a stereotype with component name */ protected boolean isStereotypeWithNameValue(String annotationType, - Set metaAnnotationTypes, @Nullable Map attributes) { + Set metaAnnotationTypes, Map attributes) { boolean isStereotype = metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) || annotationType.equals("jakarta.annotation.ManagedBean") || @@ -200,7 +200,7 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator { annotationType.equals("jakarta.inject.Named") || annotationType.equals("javax.inject.Named"); - return (isStereotype && attributes != null && attributes.containsKey("value")); + return (isStereotype && attributes.containsKey("value")); } /**