Description
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:
- SPR-12443 breaks Spring Security's AuthenticationConfiguration [SPR-12488] #17094 SPR-12443 breaks Spring Security's AuthenticationConfiguration
- BeanMethodInterceptor doesn't forward user-provided arguments to getBean(name, args) [SPR-12443] #17048 BeanMethodInterceptor doesn't forward user-provided arguments to getBean(name, args)
- ObjectFactory lacks method for getting bean with specified constructor arguments [SPR-13956] #18529 ObjectFactory lacks method for getting bean with specified constructor arguments