Polishing

This commit is contained in:
Juergen Hoeller
2026-04-01 21:15:58 +02:00
parent e78af58af3
commit 3f01e3fe11
@@ -103,7 +103,6 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator {
private final Map<String, Set<String>> 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));
}