-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Bean
method that declares @Autowired
/@Qualifier
use case no longer supported
#33990
Comments
@Bean
method declares @Autowired
qualifier usecase no longer supported
@Bean
method declares @Autowired
qualifier usecase no longer supported@Bean
method that declares @Autowired
qualifier use case no longer supported
Hi @harmonic-ben,
In other words, prior to 6.2, In addition, meta-annotating In light of that, I would generally recommend removing In any case, we will brainstorm within the team and get back to you. Cheers, Sam [1] |
@Bean
method that declares @Autowired
qualifier use case no longer supported@Bean
method that declares @Autowired
/@Qualifier
use case no longer supported
Cool I have enough guidance to know its probably not a great idea and will clean it up in our codebase. Will leave this open in case you decide something different. |
Thanks for the feedback, @harmonic-ben. 👍 In end the end, we have decided to leave things as-is, since the use of In light of that, I'm closing this issue. Cheers, Sam |
Overview
@Bean
method declares@Autowired
as well #33051The change to prevent
@Autowired
on a@Bean
method prevents the following use case.Before I go change all the code to reflect the new limitations I want to make sure this was an intended side effect.
Use Case
Create an annotation like:
Use the annotation when setting up
@Configuration
.Use the annotation in a variety of contexts.
After this change I will remove
@Autowired
from the annotation class and selectively add toFieldInjected
andSetterInjected
use cases.My question is:
Was the change worth it?
Or is it worth undoing the change to save me and others from having to rework our code bases?
I'll refactor everywhere if I need to, but it didn't look like #33051 discussed this side effect.
The text was updated successfully, but these errors were encountered: