From 3f01e3fe11927430160a931483aa0e4a4896c148 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 1 Apr 2026 21:15:58 +0200 Subject: [PATCH] Polishing --- .../context/annotation/AnnotationBeanNameGenerator.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 a1397a30167..19ef319fd48 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 @@ -103,7 +103,6 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator { private final Map> metaAnnotationTypesCache = new ConcurrentHashMap<>(); - @Override public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) { if (definition instanceof AnnotatedBeanDefinition annotatedBeanDefinition) { @@ -200,8 +199,7 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator { return names.get(0); } if (names.size() > 1) { - throw new IllegalStateException( - "Stereotype annotations suggest inconsistent component names: " + names); + throw new IllegalStateException("Stereotype annotations suggest inconsistent component names: " + names); } return null; } @@ -219,7 +217,6 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator { boolean isStereotype = metaAnnotationTypes.contains(COMPONENT_ANNOTATION_CLASSNAME) || annotationType.equals("jakarta.inject.Named"); - return (isStereotype && attributes.containsKey(MergedAnnotation.VALUE)); }