[cdi-dev] [JBoss JIRA] (CDI-517) assignability to parameterized required type

Jozef Hartinger (JIRA) issues at jboss.org
Mon Mar 16 06:14:19 EDT 2015


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

Jozef Hartinger commented on CDI-517:
-------------------------------------

{quote}2 days before the CDI-1.1 spec went PDF{quote}
False. See Martin's comment for details.

{quote}backward-incomatible change was made{quote}
False. CDI 1.0 did not allow this. Therefore, specifying this in CDI 1.1 is backward compatible from the spec point of view.

{quote}not compatible with the JavaEE6 RI and the CDI-1.0 RI where this was explicitly allowed.{quote}
False. It was never *explicitly allowed*. It was *implicity* allowed by a bug in CDI RI.

Now to get to your point the usage of "raw references to generic types" (called simply raw types hereafter) is discouraged by the JLS, supported only to provide compatibility with legacy pre Java 1.5 code and generates a compiler warning. Therefore, people should not be using it in the first place. You're right that fixing the Weld bug caused a few problems here and there where people were still using raw types. This is unfortunate but hardly anything can be done about it at this point especially given that this was already dealt with in CDI-304.

> assignability to parameterized required type
> --------------------------------------------
>
>                 Key: CDI-517
>                 URL: https://issues.jboss.org/browse/CDI-517
>             Project: CDI Specification Issues
>          Issue Type: Bug
>          Components: Resolution
>    Affects Versions: 1.1.PFD, 1.2.Final
>            Reporter: Mark Struberg
>
> 2 days before the CDI-1.1 spec went PDF the following backward-incomatible change was made:
> {quote}
> -A raw bean type is considered assignable to a parameterized required type if the raw types are identical.
> + A raw bean type is considered assignable to a parameterized required type if the raw types are identical and all type parameters of the bean type are either unbounded type variables or java.lang.Object.
> {quote} 
> This breaks a lot of projects and also is also not compatible with the JavaEE6 RI and the CDI-1.0 RI where this was explicitly allowed.
> This is a follow up to CDI-304.



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


More information about the cdi-dev mailing list