mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
Polishing
This commit is contained in:
+1
-4
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user