Closed
Description
Michael Isvy opened SPR-6885 and commented
All @Configuration
classes are dynamically subclassed with CGLIB, and the MethodInterceptor that is applied in the overridden versions of all @Bean
methods check the container first for any cached (scoped) beans, of course including singletons.
See ConfigurationClassEnhancer and BeanMethodInterceptor for details.
For this reason, @Configuration
classes have certain restrictions, such as that they (and their @Bean
methods) may not be final; they must have a no-arg constructor, etc.