Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-585

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.1
    • 1.1.1
    • Events
    • None

    Description

      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>

      Attachments

        Activity

          People

            djencks David Jencks
            djencks David Jencks
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: