-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Clarify bean ordering when iterating over an instance #42949
Conversation
I also created a discussion in CDI to see if it's relevant to include this in the spec: |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I added a few suggestions and will let @mkouba review.
@@ -957,6 +957,27 @@ Alternatively, you can use the `@LookupIfProperty` and `@LookupUnlessProperty` a | |||
} | |||
---- | |||
|
|||
if there is more than one bean that matches the required type and qualifiers and is eligible for injection, it is possible to iterate (or stream) available bean instances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this paragraph would deserve a separate section with title along the lines of "Sorting beans obtained with programmatic lookup".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I'd add it as a separate non-standard feature.
Ideally with a use case (why you might need it) and with an example showing two prioritized beans (and third with no prio?) and what the ordering looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkouba , just updated the PR, WDYT ?
035b7b3
to
4c79973
Compare
🙈 The PR is closed and the preview is expired. |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Guillaume Smet <[email protected]>
4c79973
to
1870f6c
Compare
Status for workflow
|
cc @mkouba