felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1549728 - in /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager: DependencyManager.java ServiceTracker.java
Date Tue, 10 Dec 2013 01:19:50 GMT
Author: djencks
Date: Tue Dec 10 01:19:49 2013
New Revision: 1549728

URL: http://svn.apache.org/r1549728
Log:
FELIX-4350 Fix race between service tracker open and service removed event

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java?rev=1549728&r1=1549727&r2=1549728&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
Tue Dec 10 01:19:49 2013
@@ -942,10 +942,7 @@ public class DependencyManager<S, T> imp
         public void removedService( ServiceReference<T> serviceReference, RefPair<T>
refPair, int trackingCount )
         {
             m_componentManager.log( LogService.LOG_DEBUG, "dm {0} tracking {1} SingleStatic
removed {2} (enter)", new Object[] {getName(), trackingCount, serviceReference}, null );
-            if ( refPair != null ) //TODO needs investigation
-            {
-                refPair.setDeleted( true );
-            }
+            refPair.setDeleted( true );
             this.trackingCount = trackingCount;
             tracked( trackingCount );
             boolean reactivate;

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java?rev=1549728&r1=1549727&r2=1549728&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ServiceTracker.java Tue
Dec 10 01:19:49 2013
@@ -1249,6 +1249,9 @@ public class ServiceTracker<S, T> {
                 object = tracked.remove(item); /*                                       
         * must remove from tracker before
                                                  * calling customizer callback
                                                  */
+                if (object == null) { /* are we actually tracking the item */
+                    return;
+                }
                 trackingCount = modified(); /* increment modification count */
             }
             if (DEBUG) {



Mime
View raw message