Skip to content

GenericApplicationContext.registerBean should support non-default constructors [SPR-17292] #21825

@spring-projects-issues

Description

@spring-projects-issues

Juergen Hoeller opened SPR-17292 and commented

While AnnotationConfigApplicationContext.registerBean supports @Autowired resolution on constructors in case of no instance supplier given, the original method on GenericApplicationContext performs default instantiation only. Making GenericApplicationContext.registerBean smarter in detecting a Kotlin primary constructor or simple non-default public constructor scenarios makes it aligned with AnnotationConfigApplicationContext and more useful in general, in particular for Kotlin DSLs.


Issue Links:

Referenced from: commits 47d6e91, d3c0855

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