We previously [1] changed the ambiguity resolution wording from
> The container eliminates all eligible beans that are not alternatives,
> except for producer methods and fields of beans that are alternatives.
to
> The container eliminates all eligible beans that are not alternatives
> selected for the application, except for producer methods and fields
> of beans that are alternatives.
At that time, we did _not_ add a rule to the CDI Full section that would
cover alternatives selected for the bean archive.
Note that for a bean to be _eligible_, it must be _available for injection_,
and an alternative is available for injection only if it is selected (for
application in CDI Lite; for application or for bean archive in CDI Full).
Alternative beans that are not selected are hence not even considered during
ambiguity resolution, so the ambiguity resolution description does not need
to mention them at all. This is why the previous description is correct.
Now, only eliminating beans that are not alternatives selected for application,
as the new text says, would mean that in CDI Full, beans that are alternatives
selected for bean archive would also be eliminated. That would be wrong.
Therefore, this change is incorrect. Of course, no implementation actually
made that change in behavior, and the TCK wasn't adjusted either.
There are 2 ways to fix this: revert to previous wording, or add extra wording
to the CDI Full section:
> The container eliminates all eligible beans that are not alternatives
> selected for the bean archive or selected for the application, except
> for producer methods and fields of beans that are alternatives.
This would be similar how ambiguous name resolution is specified.
This commit simply reverts to the previous wording, because that's easier,
even though it leads to slight inconsistency between ambiguous dependency
resolution and ambiguous name resolution. That inconsistency exists since
CDI 1.1, so is not an issue.
[1] jakartaee@1840939