mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Properly detect importing class metadata for lite configuration class
Closes gh-22920
This commit is contained in:
+1
-1
@@ -460,7 +460,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) {
|
||||
if (bean instanceof ImportAware) {
|
||||
ImportRegistry ir = this.beanFactory.getBean(IMPORT_REGISTRY_BEAN_NAME, ImportRegistry.class);
|
||||
AnnotationMetadata importingClass = ir.getImportingClassFor(bean.getClass().getSuperclass().getName());
|
||||
AnnotationMetadata importingClass = ir.getImportingClassFor(ClassUtils.getUserClass(bean).getName());
|
||||
if (importingClass != null) {
|
||||
((ImportAware) bean).setImportMetadata(importingClass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user