geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r776328 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java
Date Tue, 19 May 2009 14:31:53 GMT
Author: gnodet
Date: Tue May 19 14:31:52 2009
New Revision: 776328

URL: http://svn.apache.org/viewvc?rev=776328&view=rev
Log:
Fix possible NPE

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java?rev=776328&r1=776327&r2=776328&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java
Tue May 19 14:31:52 2009
@@ -59,6 +59,7 @@
 
     public DefaultBlueprintContextEventSender(final BundleContext bundleContext) {
         this.extenderBundle = bundleContext.getBundle();
+        this.states = new ConcurrentHashMap<Bundle, Object>();
         this.eventAdminServiceTracker = new ServiceTracker(bundleContext, EventAdmin.class.getName(),
null);
         this.eventAdminServiceTracker.open();
         this.contextListenerTracker = new ServiceTracker(bundleContext, BlueprintContextListener.class.getName(),
new ServiceTrackerCustomizer() {
@@ -74,13 +75,14 @@
             }
         });
         this.contextListenerTracker.open();
-        this.states = new ConcurrentHashMap<Bundle, Object>();
         this.registration = bundleContext.registerService(BlueprintStateManager.class.getName(),
this, null);
     }
 
     protected void sendInitialEvents(BlueprintContextListener listener) {
-        for (Map.Entry<Bundle, Object> entry : states.entrySet()) {
-            callListener(listener, entry.getKey(), entry.getValue());
+        if (states != null) {
+            for (Map.Entry<Bundle, Object> entry : states.entrySet()) {
+                callListener(listener, entry.getKey(), entry.getValue());
+            }
         }
     }
 



Mime
View raw message