[cdi-dev] [JBoss JIRA] (CDI-220) behaviour of CDI bean @Specializes session bean is undefined

Tomas Remes (JIRA) issues at jboss.org
Thu Sep 8 07:43:01 EDT 2016


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

Tomas Remes commented on CDI-220:
---------------------------------

Just for record. Both options which should fail (session bean specializes managed bean and vice versa) have been tested for really long time:.
See https://github.com/cdi-spec/cdi-tck/blob/1.1.0.Final/impl/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/simple/broken/extendejb/SpecializingBeanExtendsEnterpriseBeanTest.java
and https://github.com/cdi-spec/cdi-tck/blob/1.1.0.Final/impl/src/main/java/org/jboss/cdi/tck/tests/inheritance/specialization/enterprise/broken/extend/managedbean/DirectlyExtendsSimpleBeanTest.java

> behaviour of CDI bean @Specializes session bean is undefined
> ------------------------------------------------------------
>
>                 Key: CDI-220
>                 URL: https://issues.jboss.org/browse/CDI-220
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>          Components: Java EE integration
>    Affects Versions: 1.0, 1.1.EDR
>            Reporter: Mark Struberg
>            Assignee: Antoine Sabot-Durand
>              Labels: CDI_spec_chge, F2F2016
>             Fix For: 2.0 (discussion)
>
>
> The current spec doesn't define what should happen if a CDI bean @Specializes a session bean, e.g.
> @Stateless
> public class Horse {..}
> @ApplicationScoped @Specializes
> public class Trakehner extends Horse {..}
> Section 3.2.4 explicitely forbids the other way around. I think we should also treat the above case as error.
> Otherwise we would end up getting different results whether we use @Inject or @EJB to inject a Horse.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list