mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Merge branch '6.2.x'
# Conflicts: # framework-platform/framework-platform.gradle # spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java
This commit is contained in:
+1
@@ -131,6 +131,7 @@ final class ConfigurationClass {
|
||||
* @param metadata the metadata for the underlying class to represent
|
||||
* @param beanName name of the {@code @Configuration} class bean
|
||||
* @param scanned whether the underlying class has been registered through a scan
|
||||
* @since 6.2
|
||||
*/
|
||||
ConfigurationClass(AnnotationMetadata metadata, String beanName, boolean scanned) {
|
||||
Assert.notNull(beanName, "Bean name must not be null");
|
||||
|
||||
+2
-2
@@ -195,14 +195,14 @@ class ConfigurationClassBeanDefinitionReader {
|
||||
AnnotationAttributes bean = AnnotationConfigUtils.attributesFor(metadata, Bean.class);
|
||||
Assert.state(bean != null, "No @Bean annotation attributes");
|
||||
|
||||
// Consider name and any aliases
|
||||
// Consider name and any aliases.
|
||||
String[] explicitNames = bean.getStringArray("name");
|
||||
String beanName;
|
||||
String localBeanName;
|
||||
if (explicitNames.length > 0 && StringUtils.hasText(explicitNames[0])) {
|
||||
beanName = explicitNames[0];
|
||||
localBeanName = beanName;
|
||||
// Register aliases even when overridden below
|
||||
// Register aliases even when overridden below.
|
||||
for (int i = 1; i < explicitNames.length; i++) {
|
||||
this.registry.registerAlias(beanName, explicitNames[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user