Skip to content

Avoid unnecessary CGLIB processing on configuration classes #34486

Closed
@jhoeller

Description

@jhoeller

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).

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions