-
Notifications
You must be signed in to change notification settings - Fork 77
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 ambiguity resolution during dynamic lookup #627
Conversation
Also the ambiguity resolution process is described in a way that it always, unconditionally, eliminates all non-alternative beans -- which would technically mean that dynamic lookup of an ambiguous dependency for which no alternative exists should always end up empty. Which is clearly not what happens in existing implementations :-) |
I tend to disagree. The spec is clear that "When an ambiguous dependency exists, the container attempts to resolve the ambiguity." |
I think you are reading too much into it :) |
Exactly! And the first step of the ambiguity resolution process is elimination of non-alternative beans. If ambiguity exists but no eligible bean is an alternative, the ambiguity resolution process ends with no candidate. I'm trying to describe
Right. As a spec lawyer wannabe, I still find that deeply disturbing 😆
No, you get all the eligible beans after the elimination process, that's what we investigated yesterday. (Unless all beans are eliminated :-) ) |
Not really, the ambiguity resolution process ends with an unresolvable dependency ;-). But yes, the behavior is undefined. |
Yes, that's what I tried to describe but worded it imprecisely.
Uff, you'd have to then make the spec even harder to read and expand on what's eligible bean while talking resolution process and then go in depth on describing the various outcomes you can have when interacting with |
This is important though ;-) For example, the specification of
I actually think I can fix that by adding one more sentence to the description of |
2001105
to
edd01e4
Compare
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.
Had some off-list discussion with Ladislav and I think this state of PR is fine.
Just for the sake of clarity, this doesn't change any of current behaviors, it is purely a clarification of existing state.
Thanks! I'll check the TCK and possibly submit a PR there, then. |
This attempts to clarify the current specification of `Instance.iterator()`, `Instance.stream()` and `Instance.handles()` in presence of dependency ambiguity. My understanding is that this modification is what has always been intended and how current implementations already work.
edd01e4
to
3d3e183
Compare
Going to merge this one so that it doesn't linger.
@Ladicek if there is any PR needed on TCK side, please create a tracking issue so that it is not forgotten. |
This attempts to clarify the current specification of
Instance.iterator()
,Instance.stream()
andInstance.handles()
in presence of dependencyambiguity. My understanding is that this modification is what has always
been intended and how current implementations already work.