-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
When a configuration class is annotated with @Configuration(proxyBeanMethods = false) and also implements ImportAware, the method setImportMetadata never gets called.
I have created a sample that demonstates this behaviour through a failing test
https://github.com/eleftherias/spring-import-aware-no-proxy/blob/master/src/test/java/com/example/importawarenoproxy/ImportAwareNoProxyApplicationTests.java
It seems to be cause by this line
Line 463 in c366e20
| AnnotationMetadata importingClass = ir.getImportingClassFor(bean.getClass().getSuperclass().getName()); |
When a configuration class e.g BasicConfig is annotated with @Configuration the bean class is BasicConfig$$EnhancerBySpringCGLIB and the superclass name is BasicConfig.
However, when the class is annotated with @Configuration(proxyBeanMethods = false) the bean class is BasicConfig and the superclass is Object, which causes the importingClass to be null.