servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r679440 - /servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
Date Thu, 24 Jul 2008 16:01:37 GMT
Author: gnodet
Date: Thu Jul 24 09:01:36 2008
New Revision: 679440

URL: http://svn.apache.org/viewvc?rev=679440&view=rev
Log:
SM-1438: NPE in the specs when uninstalling bundle

Modified:
    servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java

Modified: servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java?rev=679440&r1=679439&r2=679440&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
(original)
+++ servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
Thu Jul 24 09:01:36 2008
@@ -47,7 +47,7 @@
 
     public synchronized void stop(BundleContext bundleContext) throws Exception {
         while (!factories.isEmpty()) {
-            unregister(bundleContext.getBundle(factories.keySet().iterator().next()));
+            unregister(factories.keySet().iterator().next());
         }
         this.bundleContext = null;
     }
@@ -56,7 +56,7 @@
         if (event.getType() == BundleEvent.RESOLVED) {
             register(event.getBundle());
         } else if (event.getType() == BundleEvent.UNRESOLVED) {
-            unregister(event.getBundle());
+            unregister(event.getBundle().getBundleId());
         }
     }
 
@@ -92,8 +92,8 @@
         }
     }
 
-    protected void unregister(Bundle bundle) {
-        Map<String, Callable<Class>> map = factories.remove(bundle.getBundleId());
+    protected void unregister(long bundleId) {
+        Map<String, Callable<Class>> map = factories.remove(bundleId);
         if (map != null) {
             for (Map.Entry<String, Callable<Class>> entry : map.entrySet()) {
                 OsgiLocator.unregister(entry.getKey(), entry.getValue());



Mime
View raw message