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/03/01 18:15:38 UTC

svn commit: r1075931 - /myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java

Author: mfreedman
Date: Tue Mar  1 17:15:38 2011
New Revision: 1075931

URL: http://svn.apache.org/viewvc?rev=1075931&view=rev
Log:
PORTLETBRIDGE-184: NPE in getResourceRequestScopeId if scopeId not found in cache.

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

Modified: myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java?rev=1075931&r1=1075930&r2=1075931&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java (original)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java Tue Mar  1 17:15:38 2011
@@ -1854,9 +1854,16 @@ public class BridgeImpl
   {
 
     // get the render scope this resource request is contained in
-    String scopeId = getRequestScopeId(request);
-       
-    if (scopeId == null)
+    String scopeId = getRequestScopeId(request);    
+    Map<String, Object> m = null;
+    
+    if (scopeId != null)
+    {
+      m = getScopeMap(scopeId);
+    }
+    
+    // Its possible to be passed a scope but for that scope to have been dropped from the cache in the meantime
+    if (scopeId == null || m == null)
     {
       // first request is a resource request
       // create a scope and store in the session until an action occurs
@@ -1865,7 +1872,6 @@ public class BridgeImpl
     }
     
     // Check to see if this resource request is targeting the same view or a different one
-    Map<String, Object> m = getScopeMap(scopeId);
     Map<String, String> childResourceScopeMap = (Map<String, String>) m.get(CHILD_RESOURCE_REQUEST_SCOPE_MAP);
     String scopeIdKey = (String) m.get(SCOPE_VIEW_KEY);
     String childIdKey = getScopeViewKey(extCtx);