Skip to content

Regression: SPR-12443 breaks singleton bean references within a configuration class with null arguments [SPR-13887] #18460

Closed
@spring-projects-issues

Description

@spring-projects-issues

László Váradi opened SPR-13887 and commented

We are using @Configuration classes over a hundred of modules now, and just tried to upgrade from 4.1.1 to 4.1.9. However we have faced that the internal method calls now passes the arguments.

Singleton bean methods have arguments also, its dependencies. Until now, we have called these methods internally with null arguments, but it won't work now, because in this way BeanFactory will skip to lookup arguments, but will use the provided null argument, if the bean is not already created.

#17048 is about prototype beans, but it is applied to all beans, and removed a check from AbstractBeanFactory mentioned in #17094.

BeanMehtodInterceptor should really pass arguments only in case of prototype bean, or AbstractBeanFactory should avoid passed arguments in case of singleton beans, but as it is now, it is not consistent. Bean creation depends on bean creation order (created as it own, or as a depenency)


Affects: 4.1.9

Issue Links:

Referenced from: commits 5ed9046, d2b9dbf

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions