felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1493095 - /felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java
Date Fri, 14 Jun 2013 14:39:25 GMT
Author: clement
Date: Fri Jun 14 14:39:24 2013
New Revision: 1493095

URL: http://svn.apache.org/r1493095
Log:
Defensive access to the reference list.

Modified:
    felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java

Modified: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java?rev=1493095&r1=1493094&r2=1493095&view=diff
==============================================================================
--- felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java
(original)
+++ felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/dependency/impl/ServiceReferenceManager.java
Fri Jun 14 14:39:24 2013
@@ -80,6 +80,7 @@ public class ServiceReferenceManager imp
      */
     private LinkedList<ServiceTrackingInterceptor> m_trackingInterceptors = new
             LinkedList<ServiceTrackingInterceptor>();
+    private List<ServiceReference> serviceReferencesList;
 
     /**
      * Creates the service reference manager.
@@ -232,11 +233,14 @@ public class ServiceReferenceManager imp
             ServiceReference oldBest = getFirstService();
             // Recompute the matching services.
             m_matchingReferences.clear();
-            for (ServiceReference reference : m_dependency.getTracker().getServiceReferencesList())
{
-                TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
-                ref = accept(ref);
-                if (ref != null) {
-                    m_matchingReferences.put(reference, ref);
+            serviceReferencesList = m_dependency.getTracker().getServiceReferencesList();
+            if (serviceReferencesList != null) {
+                for (ServiceReference reference : serviceReferencesList) {
+                    TransformedServiceReference ref = new TransformedServiceReferenceImpl(reference);
+                    ref = accept(ref);
+                    if (ref != null) {
+                        m_matchingReferences.put(reference, ref);
+                    }
                 }
             }
 



Mime
View raw message