mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
a455317122
Prior to this commit, if a non-annotated [1] class was registered directly with an ApplicationContext -- for example, via AnnotatedBeanDefinitionReader, AnnotationConfigApplicationContext, or @ContextConfiguration -- it was not considered a configuration class in 'lite' mode unless @Bean methods were declared locally. In other words, if the registered class didn't declare local @Bean methods but rather extended a class that declared @Bean methods, then the registered class was not parsed as a @Configuration class in 'lite' mode, and the @Bean methods were ignored. Whereas, a non-annotated class registered via @Import is always considered to be a configuration class candidate. To address this discrepancy between @Import'ed classes and classes registered directly with an ApplicationContext, this commit treats any class registered via AnnotatedBeanDefinitionReader as a @Configuration class candidate with @Bean 'lite' mode semantics. [1] In this context, "non-annotated" means a class not annotated (or meta-annotated) with @Component, @ComponentScan, @Import, or @ImportResource. Closes gh-30449