DerekYRC / mini-spring

mini-spring是简化版的spring框架,能帮助你快速熟悉spring源码和掌握spring的核心原理。抽取了spring的核心逻辑,代码极度简化,保留spring的核心功能,如IoC和AOP、资源加载器、事件监听器、类型转换、容器扩展点、bean生命周期和作用域、应用上下文等核心功能。

Home Page:https://github.com/DerekYRC/mini-spring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

auto-proxy中的被代理类只实例化而没有填充属性?

KeenRunner opened this issue · comments

DefaultAdvisorAutoProxyCreator类的postProcessBeforeInstantiation方法中,只是调用了instantiate方法来实例化bean,没有填充属性,不知道算不算一个bug?

DefaultAdvisorAutoProxyCreator类的postProcessBeforeInstantiation方法中,只是调用了instantiate方法来实例化bean,没有填充属性,不知道算不算一个bug?

是bug。在populate-proxy-bean-with-property-values分支中修复了,将织入逻辑迁移到BeanPostProcessor#postProcessAfterInitialization,即将DefaultAdvisorAutoProxyCreator#postProcessBeforeInstantiation的内容迁移到DefaultAdvisorAutoProxyCreator#postProcessAfterInitialization中。
详情见“bug fix:没有为代理bean设置属性”小节

微信图片_20210116220140