[ 
https://issues.apache.org/jira/browse/DELTASPIKE-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13755678#comment-13755678
 ] 

Jozef Hartinger commented on DELTASPIKE-405:
--------------------------------------------

{quote}
1. you have a generic injection point ('required type') and a generic bean
IP: @Inject Stable<Horse> stable;
bean: @Produces Stable<Horse> ...
{quote}
Correct

{quote}
2. you have a raw injection point and a generic bean, e.g
IP: @Inject Stable stable;
bean: @Produces Stable<Horse> ..
{quote}

Incorrect. The bean is not assignable. Both CDI 1.0 and CDI 1.1 specs say:
"A parameterized bean type (Stable<Horse>) is considered assignable to a raw 
required type (Stable) if the raw types are identical (yes, they are) and all 
type parameters of the bean type are either unbounded type variables or 
java.lang.Object (Horse is neither unbounded type variable nor 
java.lang.Object)."

{quote}
3. you have a raw injection point ('required type') and a generic unbound or 
erased bean
IP: @Inject Stable stable;
bean: @Produces <PET> Stable<PET> ..
{quote}
Correct. This scenario fulfils the rule above. Both in CDI 1.0 and CDI 1.1

{quote}
Those cases are defined in 5.2.3 (in CDI-1.1: ยง5.2.4). And they do clearly not 
cover (and thus disallow) the following case:
IP: @Inject Stable<Horse>
bean: @Produces <PET> Stable<PET> ..
{quote}
Incorrect. This case is handled by the fourth bullet in CDI 1.0

"the required type parameter is an actual type, the bean type parameter is a 
type variable and the actual type is assignable
to the upper bound, if any, of the type variable, or"

thus allowed.

{quote}
IP: @Inject Stable<Horse>
bean: @Produces Stable

Sadly there is another sentence which got added to CDI-1.1 just a few lines 
below the example:
"A raw bean type is considered assignable to a parameterized required type if 
the raw types are identical and all type parameters of the required type are 
either unbounded type variables or java.lang.Object"
But this one does completely contradict the sample above, isn't?
{quote}

Let me remind you that it was you who initiated this change in CDI 1.1. In CDI 
1.0 there was no such statement and therefore no raw producers allowed at all. 
In CDI this was softened by the statement you quoted. Nevertheless, your 
example is not allowed in CDI 1.0 nor CDI 1.1.

                
> producer for JsfMessage<T> does not match CDI-1.1 rules 
> --------------------------------------------------------
>
>                 Key: DELTASPIKE-405
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-405
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: JSF-Module
>    Affects Versions: 0.4
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 0.5
>
>
> Some containers don't find the JsfMessageProducer as it is of a generic type 
> <T>.

--
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

Reply via email to