Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0, 3.0.1
-
None
Description
The PortletSessionScopedBeanMap.remove() method contains the following code:
if (bi != null) { beans.remove(bean); bi.crco.release(); bean.destroy((T)bi.instance, (CreationalContext<T>)bi.crco); }
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:
if (bi != null) { beans.remove(id); bi.crco.release(); bean.destroy((T)bi.instance, (CreationalContext<T>)bi.crco); }
The reason why this was not discovered earlier is because the PortletSessionScopedBeanMap.remove() method was only called by the valueUnbound(HttpSessionBindingEvent evt) method which includes a call to beans.clear() after iterating through all the beans.