Skip to content

Commit

Permalink
Revert incorrect change in ambiguity resolution
Browse files Browse the repository at this point in the history
We previously [1] changed wording in the ambiguity resolution specification from

> Return an `Iterator`, that iterates over the set of contextual references
> for the resulting beans and required type, as defined in <<contextual_reference>>.

to

> Return an `Iterator`, that iterates over the set of contextual references
> for the resulting beans, as defined in <<contextual_reference>>.

This was an attempt to simplify the text, but is in fact incorrect, because
a contextual reference is always determined by the bean and the bean type.

This commit reverts to the previous wording.

[1] 74827d2
  • Loading branch information
Ladicek authored and manovotn committed Feb 26, 2024
1 parent 5cd17de commit d9f95b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/src/main/asciidoc/core/injectionandresolution.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,15 @@ The `iterator()` method must:
* If typesafe resolution results in an unsatisfied dependency, the set of resulting beans is empty.
If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains at least one alternative, the set of resulting beans contains all beans that were not eliminated during ambiguity resolution.
If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains no alternative, the set of resulting beans contains all candidate beans.
* Return an `Iterator`, that iterates over the set of contextual references for the resulting beans, as defined in <<contextual_reference>>.
* Return an `Iterator`, that iterates over the set of contextual references for the resulting beans and required type, as defined in <<contextual_reference>>.

The `stream()` method must:

* Identify the set of beans that have the required type and required qualifiers and are eligible for injection into the class into which the parent `Instance` was injected, according to the rules of typesafe resolution, as defined in <<performing_typesafe_resolution>>, resolving ambiguities according to <<unsatisfied_and_ambig_dependencies>>.
* If typesafe resolution results in an unsatisfied dependency, the set of resulting beans is empty.
If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains at least one alternative, the set of resulting beans contains all beans that were not eliminated during ambiguity resolution.
If typesafe resolution results in an ambiguous dependency and the set of candidate beans contains no alternative, the set of resulting beans contains all candidate beans.
* Return a `Stream`, that can stream over the set of contextual references for the resulting beans, as defined in <<contextual_reference>>.
* Return a `Stream`, that can stream over the set of contextual references for the resulting beans and required type, as defined in <<contextual_reference>>.

The methods `isUnsatisfied()`, `isAmbiguous()` and `isResolvable()` must:

Expand Down

0 comments on commit d9f95b4

Please sign in to comment.