Skip to content

@Scope and other common bean annotations on nested @Component classes [SPR-12486] #17092

Closed
@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-12486 and commented

A nested static class inside @Configuration is considered for inclusion in the bean factory, and if it is a @Component you get a bean definition, but the @Scope on the class is ignored. A bean that is created by a component scan does not behave this way (I presume), neither does it when added explicitly to the bean factory (e.g. in the constructor of AnnotationConfigApplicationContext).

I think #16497 refers obliquely to this problem. #13365 also looks relevant.


Affects: 4.1.2

Reference URL: spring-attic/spring-framework-issues#88

Issue Links:

Referenced from: commits c5c5473

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions