[cdi-dev] [JBoss JIRA] (CDI-232) Relax requirements for built-in Instance

Jozef Hartinger (JIRA) issues at jboss.org
Tue Jan 6 06:49:30 EST 2015


    [ https://issues.jboss.org/browse/CDI-232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030139#comment-13030139 ] 

Jozef Hartinger commented on CDI-232:
-------------------------------------

No, the behavior is correct. It's the way the behavior is defined that is problematic.

The expected behavior is that no matter what legal type X and qualifiers you choose, you'll always get instance injected for Instance<X> and given qualifiers. The way this is specified is by saying that the built-in bean has
{quote} 
• Instance<X> and Provider<X> for every legal bean type X in its set of bean types,
• every qualifier type in its set of qualifier types
{quote}

Combined with how CDI resolution rules work this gets the job done (since the built-in bean has all the types and qualifiers, it will always be resolved). In theory this approach is correct. However, it is difficult to materialize since it uses infinite sets (e.g. Bean<Instance>.getTypes() should strictly speaking return and infinite set of all possible bean types) which is inconvenient at best



> Relax requirements for built-in Instance
> ----------------------------------------
>
>                 Key: CDI-232
>                 URL: https://issues.jboss.org/browse/CDI-232
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>    Affects Versions: 1.1.EDR
>            Reporter: Martin Kouba
>             Fix For: 2.0 (discussion)
>
>
> 5.6.2. The built-in Instance
> {quote}
> The container must provide a built-in bean with:
> * Instance<X> and Provider<X> for every legal bean type X in its set of bean types,
> * every qualifier type in its set of qualifier types,
> {quote}
> This type/qualifier requirements seem to be too strict. Maybe we should omit these and instead force implementation to satisfy every injection point for every legal bean type and corresponding qualifiers found in application... or something like that. I'm not sure about the wording.
> By the way Weld (2.0.0.Alpha2) does not fulfil these requirements at the moment.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)



More information about the cdi-dev mailing list