[cdi-dev] [JBoss JIRA] (CDI-331) Instance.iterator() shouldn't include non-alternatives that haven't been replaced

Jozef Hartinger (JIRA) jira-events at lists.jboss.org
Wed Mar 6 12:18:56 EST 2013


     [ https://issues.jboss.org/browse/CDI-331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jozef Hartinger updated CDI-331:
--------------------------------

    Description: 
The specification currently says that:

{quote}
The iterator() 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 Section 5.2.1.
{quote}

The ambiguity resolution algorithm as defined in 5.2.2 should be applied.

This is explicitly required for get() but is not required for iterator(). This causes the following inconsistency:

Assume two classes Foo and Bar which both implement common interface Common. Bar is an enabled alternative.

Assume further the following 
{noformat}
@Inject @Any Instance<Common> instance
{noformat}
injection point.

It is clear that instance.get() returns Bar.

It is however not clear whether instance.iterator() iterates over:
a) Bar
b) Foo, Bar

and whether instance.isAmbiguous() returns:
a) true
b) false

  was:
The specification currently says that:

{quote}
The iterator() 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 Section 5.2.1.
{quote}

The ambiguity resolution algorithm as defined in 5.2.2 should be applied.

This is explicitly required for get() but is not required for iterator(). This causes the following inconsistency:

Assume two classes Foo and Bar which both implement common interface Common. Bar is an enabled alternative.

Assume further the following 
{noformat}
@Inject @Any Instance<Common> instance
{noformat}
injection point.


    
> Instance.iterator() shouldn't include non-alternatives that haven't been replaced
> ---------------------------------------------------------------------------------
>
>                 Key: CDI-331
>                 URL: https://issues.jboss.org/browse/CDI-331
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Resolution
>    Affects Versions: 1.1.PRD
>            Reporter: Jozef Hartinger
>            Assignee: Pete Muir
>             Fix For: TBD
>
>
> The specification currently says that:
> {quote}
> The iterator() 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 Section 5.2.1.
> {quote}
> The ambiguity resolution algorithm as defined in 5.2.2 should be applied.
> This is explicitly required for get() but is not required for iterator(). This causes the following inconsistency:
> Assume two classes Foo and Bar which both implement common interface Common. Bar is an enabled alternative.
> Assume further the following 
> {noformat}
> @Inject @Any Instance<Common> instance
> {noformat}
> injection point.
> It is clear that instance.get() returns Bar.
> It is however not clear whether instance.iterator() iterates over:
> a) Bar
> b) Foo, Bar
> and whether instance.isAmbiguous() returns:
> a) true
> b) false

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the cdi-dev mailing list