You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a configuration class is annotated with @Configuration(proxyBeanMethods = false) and also implements ImportAware, the method setImportMetadata never gets called.
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.
The text was updated successfully, but these errors were encountered:
When a configuration class is annotated with
@Configuration(proxyBeanMethods = false)
and also implementsImportAware
, the methodsetImportMetadata
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
spring-framework/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java
Line 463 in c366e20
When a configuration class e.g
BasicConfig
is annotated with@Configuration
the bean class isBasicConfig$$EnhancerBySpringCGLIB
and the superclass name isBasicConfig
.However, when the class is annotated with
@Configuration(proxyBeanMethods = false)
the bean class isBasicConfig
and the superclass isObject
, which causes theimportingClass
to be null.The text was updated successfully, but these errors were encountered: