felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uiter...@apache.org
Subject svn commit: r1328364 - /felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java
Date Fri, 20 Apr 2012 13:07:08 GMT
Author: uiterlix
Date: Fri Apr 20 13:07:07 2012
New Revision: 1328364

URL: http://svn.apache.org/viewvc?rev=1328364&view=rev
Log:
Fixed bug in swapped callback of AbstractDecorator. Instead of really swapping it re-added
the old service instead of the new one.

Modified:
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java?rev=1328364&r1=1328363&r2=1328364&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/AbstractDecorator.java
Fri Apr 20 13:07:07 2012
@@ -221,7 +221,11 @@ public abstract class AbstractDecorator 
     public void swapped(ServiceReference oldRef, Object oldService, ServiceReference newRef,
Object newService) {
         synchronized (m_services) {
         	Component service = (Component) m_services.remove(oldRef);
-        	m_services.put(newRef, service);
+            if (service == null) {
+                throw new IllegalStateException("Service should not be null here.");
+            }
+        	Component newComponent = createService(new Object[] { newRef, newService });
+        	m_services.put(newRef, newComponent);
         }
     }
     



Mime
View raw message