Polishing

This commit is contained in:
Sam Brannen
2023-08-27 19:25:52 +02:00
parent 95453a4427
commit f054c2e804
2 changed files with 16 additions and 18 deletions

View File

@@ -101,15 +101,13 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator {
@Nullable
protected String determineBeanNameFromAnnotation(AnnotatedBeanDefinition annotatedDef) {
AnnotationMetadata metadata = annotatedDef.getMetadata();
Set<String> annotationTypes = metadata.getAnnotationTypes();
String explicitBeanName = getExplicitBeanName(metadata);
if (explicitBeanName != null) {
return explicitBeanName;
String beanName = getExplicitBeanName(metadata);
if (beanName != null) {
return beanName;
}
String beanName = null;
for (String annotationType : annotationTypes) {
for (String annotationType : metadata.getAnnotationTypes()) {
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(metadata, annotationType);
if (attributes != null) {
Set<String> metaAnnotationTypes = this.metaAnnotationTypesCache.computeIfAbsent(annotationType, key -> {