portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r920385 - /portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
Date Mon, 08 Mar 2010 16:23:47 GMT
Author: ate
Date: Mon Mar  8 16:23:47 2010
New Revision: 920385

URL: http://svn.apache.org/viewvc?rev=920385&view=rev
Log:
Protecting against possible NPEs on RegistryEventListeners 

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java?rev=920385&r1=920384&r2=920385&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
Mon Mar  8 16:23:47 2010
@@ -310,11 +310,14 @@
             if (listeners != null && !listeners.isEmpty())
             {
                 PortletDefinition pd = this.getPortletDefinitionByUniqueName((String)key);
-                for (int ix=0; ix < listeners.size(); ix++)
+                if (pd != null)
                 {
-                    RegistryEventListener listener = listeners.get(ix);
-                    listener.portletRemoved(pd);
-                }        
+                    for (int ix=0; ix < listeners.size(); ix++)
+                    {
+                        RegistryEventListener listener = listeners.get(ix);
+                        listener.portletRemoved(pd);
+                    }        
+                }
             }           
         }
         else
@@ -324,11 +327,14 @@
             if (listeners != null && !listeners.isEmpty())
             {
                 PortletApplication pa = this.getPortletApplication((String)key);
-                for (int ix=0; ix < listeners.size(); ix++)
+                if (pa != null)
                 {
-                    RegistryEventListener listener = listeners.get(ix);
-                    listener.applicationRemoved(pa);
-                }        
+                    for (int ix=0; ix < listeners.size(); ix++)
+                    {
+                        RegistryEventListener listener = listeners.get(ix);
+                        listener.applicationRemoved(pa);
+                    }        
+                }
             }
             
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message