Neil Griffin created PLUTO-770:
----------------------------------

             Summary: PortletSessionScopedBeanMap.remove() does not remove bean 
instances from the underlying map
                 Key: PLUTO-770
                 URL: https://issues.apache.org/jira/browse/PLUTO-770
             Project: Pluto
          Issue Type: Task
          Components: portlet container
    Affects Versions: 3.0.1, 3.0.0
            Reporter: Neil Griffin
            Assignee: Neil Griffin
             Fix For: 3.0.2


The {{PortletSessionScopedBeanMap.remove()}} method contains the following code:

{code:java|title=PortletSessionScopedBeanMap.java}
if (bi != null) {
    beans.remove(bean);
    bi.crco.release();
    bean.destroy((T)bi.instance, (CreationalContext<T>)bi.crco);
}
{code}

The problem is that the {{beans}} variable is a {{java.util.Map}} whose keys 
are of type {{String}} (the windowId of the portlet) and not of type 
{{javax.enterprise.inject.spi.Bean}}. Therefore the call to 
{{beans.remove(bean)}} is incorrect and does not actually remove the bean from 
the underlying map.

The fix would be to pass the windowId instead:

{code:java|title=PortletSessionScopedBeanMap.java}
if (bi != null) {
    beans.remove(id);
    bi.crco.release();
    bean.destroy((T)bi.instance, (CreationalContext<T>)bi.crco);
}
{code}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to