Skip to content

use Constructor injection replace @Autowired(required = false)#3617

Merged
ruansheng8 merged 3 commits intoalibaba:2022.xfrom
springboot4:2022.x
Mar 7, 2024
Merged

use Constructor injection replace @Autowired(required = false)#3617
ruansheng8 merged 3 commits intoalibaba:2022.xfrom
springboot4:2022.x

Conversation

@springboot4
Copy link

Describe what this PR does / why we need it

Spring推荐使用构造器注入。编译器对于@Autowired(required = false)也会出现警告。
此pr在不改变原有api以及代码功能的前提下,使用构造器注入以及ObjectProvider替换了三个自动配置类中的@Autowired(required = false)。

@CLAassistant
Copy link

CLAassistant commented Feb 1, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@ruansheng8 ruansheng8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Collaborator

@yuluo-yx yuluo-yx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ruansheng8 ruansheng8 merged commit 4c00ada into alibaba:2022.x Mar 7, 2024
@ruansheng8 ruansheng8 added the waiting for sync waiting for sync to other main branchs label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for sync waiting for sync to other main branchs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants