Avoid unnecessary CGLIB processing on configuration classes #34486
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
If a
@Configuration
class does not declare (or inherit) any instance-level@Bean
methods, generating an enhanced subclass with CGLIB is not adding any value. This is particularly likely for "holder"-like configuration classes with just imports, not least of it all common@SpringBootApplication
classes. We can entirely skip CGLIB processing for such classes, also not incurring unnecessary potential for CGLIB class cache failures/fallbacks (#34423).The text was updated successfully, but these errors were encountered: