-
Notifications
You must be signed in to change notification settings - Fork 38.5k
findAutowireCandidates()
will either return candidates that are not selfReferenced or self referenced Collection/Map beans. Not both.
#33136
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
Comments
findAutowireCandidates()
will either return candidates that are not selfReferenced or candidates that are Collection/Map beans and are self referenced. Not both.findAutowireCandidates()
will either return candidates that are not selfReferenced or self referenced Collection/Map beans. Not both.
@ankitkpd rather than an analysis of our own code, please explain what you're trying to do. To speed up support, you can share a sample we can actually run to reproduce that behavior ourselves (no code in text please). |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
@snicoll within my system I have a base class for all spring configurations that holds a few autowired list for e.g.
Then there two separate codebases & spring boot apps with their own spring configurations. One extends
With these spring configurations setup With little bit of debugging into Thanks for your support. |
You need to make the injection of the list lazy (or not using field injection) as you're trying in the same arrangement to contribute one instance and inject the list. If you have further questions, please follow-up on StackOverflow. |
But it won't return both i.e. non self referenced candidates that are being added with
AND candidates that are Collection/Map beans & are self referenced being added with the fix i.e.
Because if condition
if (result.isEmpty())
would prevent it to do so.Is there a way to get autowired candidates of both types?
Originally posted by @ankitkpd in #13096 (comment)
The text was updated successfully, but these errors were encountered: