Martin Kouba created OWB-1209:

             Summary: Custom bean with isAlternative()=true should not be 
automatically enabled
                 Key: OWB-1209
             Project: OpenWebBeans
          Issue Type: Bug
            Reporter: Martin Kouba

It seems that if you register a custom bean where {{isAlternative()}} returns 
true, the bean is automatically enabled. However, the container should use 
{{getBeanClass()}}, see also "Declaring selected alternatives for a bean 
For a custom implementation of the Bean interface defined in The Bean 
interface, the container calls isAlternative() to determine whether the bean is 
an alternative, and getBeanClass() and getStereotypes() to determine whether an 
alternative is selected in a certain bean archive.

Moreover, if I specify the bean class of a custom bean in the {{beans.xml}} I 
get :
Given alternative class : org.jboss.cdi.builtinbeans.IntegerEventBean is not 
annotated wih @Alternative or not an enabled bean

To reproduce, checkout and 
 to always return beans.xml with enablement. Then run:

mvn clean test -DcdiImpl=owb1

This message was sent by Atlassian JIRA

Reply via email to