@Lazy injection point target is proxied twice for @Resource not matching bean name #28176
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
Overview
If the field name for a
@Lazy @Resource
does not match the bean name of the desired dependency, bothCommonAnnotationBeanPostProcessor.buildLazyResourceProxy(...)
andContextAnnotationAutowireCandidateResolver.buildLazyResolutionProxy(...)
will create proxies for the injected bean, with the latter creating a proxy that wraps the proxy created by the former.For example, in the following test case, the
fieldNameMatchesBeanName()
test passes; whereas, thefieldNameDoesNotMatchBeanName()
test fails with an error similar to the following.Related Issues
The text was updated successfully, but these errors were encountered: