You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2011/01/25 22:12:28 UTC

svn commit: r1063463 - /myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java

Author: mfreedman
Date: Tue Jan 25 21:12:28 2011
New Revision: 1063463

URL: http://svn.apache.org/viewvc?rev=1063463&view=rev
Log:
PORTLETBRIDGE-175: Bridge phase listeners have portlet dependency but can be executed in a servlet request yielding ClassCastException

Modified:
    myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java

Modified: myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java?rev=1063463&r1=1063462&r2=1063463&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java (original)
+++ myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java Tue Jan 25 21:12:28 2011
@@ -78,6 +78,7 @@ import javax.portlet.faces.BridgeDefault
 import javax.portlet.faces.BridgeException;
 import javax.portlet.faces.BridgeNotAFacesRequestException;
 import javax.portlet.faces.BridgeUninitializedException;
+import javax.portlet.faces.BridgeUtil;
 import javax.portlet.faces.annotation.BridgePreDestroy;
 import javax.portlet.faces.annotation.BridgeRequestScopeAttributeAdded;
 import javax.portlet.faces.annotation.ExcludeFromManagedRequestScope;
@@ -1667,7 +1668,7 @@ public class BridgeImpl
     // There is only one lifecycle instance within a webapp -- and lifecycles aren't thread safe
     // This means we may have multiple listeners registered and/or multiple simulataneous requests
     // So only do the work if the FacesContext of the event is equal to the one in the current thread
-    if (context != FacesContext.getCurrentInstance())
+    if (context != FacesContext.getCurrentInstance() || !BridgeUtil.isPortletRequest())
     {
       return;
     }
@@ -1706,7 +1707,7 @@ public class BridgeImpl
     // There is only one lifecycle instance within a webapp -- and lifecycles aren't thread safe
     // This means we may have multiple listeners registered and/or multiple simulataneous requests
     // So only do the work if the FacesContext of the event is equal to the one in the current thread
-    if (context != FacesContext.getCurrentInstance())
+    if (context != FacesContext.getCurrentInstance() || !BridgeUtil.isPortletRequest())
     {
       return;
     }