@Lazy injection point is resolved from BeanFactory for every invocation on proxy #28173
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
I found that, when I use
@Lazy
on@Resource
fields, Spring injects a lazy proxy.The lazy proxy's
TargetSource
is not static, so every time I invoke a method on the lazy proxy, it callsbeanFactory.resolveDependency()
to resolve the target object.Why doesn't Spring set the lazy proxy's
TargetSource
to static?If so, it will be faster when invoking the lazy proxy's methods.
For example, in
CommonAnnotationBeanPostProcessor
:The text was updated successfully, but these errors were encountered: