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 2009/08/05 00:28:05 UTC

svn commit: r801001 - /myfaces/portlet-bridge/core/tags/2.0.0-alpha-2/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java

Author: mfreedman
Date: Tue Aug  4 22:28:04 2009
New Revision: 801001

URL: http://svn.apache.org/viewvc?rev=801001&view=rev
Log:
PORTLETBRIDGE-84: NPE from null value in RequestMap

Modified:
    myfaces/portlet-bridge/core/tags/2.0.0-alpha-2/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java

Modified: myfaces/portlet-bridge/core/tags/2.0.0-alpha-2/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/tags/2.0.0-alpha-2/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java?rev=801001&r1=801000&r2=801001&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/tags/2.0.0-alpha-2/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java (original)
+++ myfaces/portlet-bridge/core/tags/2.0.0-alpha-2/impl/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeImpl.java Tue Aug  4 22:28:04 2009
@@ -1754,20 +1754,23 @@
 
   private boolean isExcludedFromBridgeRequestScope(String key, Object value, List<String> preExistingList)
   {
-    return ((value.getClass().getAnnotation(ExcludeFromManagedRequestScope.class) != null) || 
-            (preExistingList != null && preExistingList.contains(key)) ||
-            isPreDefinedExcludedObject(key, value) ||
-            isConfiguredExcludedAttribute(key));
+    return ((value != null && value.getClass().getAnnotation(ExcludeFromManagedRequestScope.class) != null) ||
+         (preExistingList != null && preExistingList.contains(key)) ||
+         isPreDefinedExcludedObject(key, value) ||
+         isConfiguredExcludedAttribute(key));
   }
 
   private boolean isPreDefinedExcludedObject(String s, Object o)
   {
-    return o instanceof PortletConfig || o instanceof PortletContext || 
+    if (o != null && (o instanceof PortletConfig || o instanceof PortletContext || 
       o instanceof PortletRequest || o instanceof PortletResponse || o instanceof PortletSession || 
       o instanceof PortletPreferences || o instanceof PortalContext || o instanceof FacesContext || 
       o instanceof ExternalContext || o instanceof ServletConfig || o instanceof ServletContext || 
-      o instanceof ServletRequest || o instanceof ServletResponse || o instanceof HttpSession || 
-      isInNamespace(s, "javax.portlet.") ||
+      o instanceof ServletRequest || o instanceof ServletResponse || o instanceof HttpSession))
+      return true;
+    else
+    {
+      return isInNamespace(s, "javax.portlet.") ||
       isInNamespace(s, "javax.portlet.faces.") ||
       isInNamespace(s, "javax.faces.") ||
       isInNamespace(s, "javax.servlet.") ||
@@ -1775,7 +1778,8 @@
       isInNamespace(s, "org.apache.myfaces.portlet.faces.") ||
       // our ExternalContext uses this prefix internally to append to url which might
       // contain another '.' -- so exclude all that are prefixed with this
-      s.startsWith("org.apache.myfaces.portlet.faces.context."); 
+      s.startsWith("org.apache.myfaces.portlet.faces.context.");
+    }
   }
 
   private boolean isConfiguredExcludedAttribute(String s)