ProcessSessionBean doesn't deal with generic type quite right (CDITCK-215)
--------------------------------------------------------------------------

                 Key: OWB-585
                 URL: https://issues.apache.org/jira/browse/OWB-585
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Events
    Affects Versions: 1.1.1
            Reporter: David Jencks
            Assignee: David Jencks
             Fix For: 1.1.1


As discussed in CDITCK-215, there's something odd in ProcessSessionBean:

ProcessSessionBean<X>  extends ProcessManagedBean<Object>

So, a ProcessSessionBean<Elephant> is not a ProcessManagedBean<Elephant> but  a 
ProcessManagedBean<Object>. So the generic type parameter depends on which 
event type you are considering the event as.

To solve this I've modified GenericBeanEvent.getBeanClass() to

    public Class<?> getBeanClassFor(Class<?> eventClass);

where you can pass in the type of the event you are thinking about.  The 
implementations are unchanged except for GProcessSessionBean where it's now:

    public Class<?> getBeanClassFor(Class<?> eventClass)
    {
        if (ProcessSessionBean.class.isAssignableFrom(eventClass))
        {
            return getBean().getBeanClass();
        }
        else
        {
            return Object.class;
        }
    }


I also corrected the type parameter in

public class ProcessSessionBeanImpl<X> extends ProcessBeanImpl<Object> 
implements ProcessSessionBean<X>




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to