felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r833085 - /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.java
Date Thu, 05 Nov 2009 17:14:15 GMT
Author: fmeschbe
Date: Thu Nov  5 17:14:14 2009
New Revision: 833085

URL: http://svn.apache.org/viewvc?rev=833085&view=rev
Log:
FELIX-1846 Guard access to the existing target filter being null

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/DependencyManager.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=833085&r1=833084&r2=833085&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
Thu Nov  5 17:14:14 2009
@@ -390,7 +390,6 @@
                 ungetService( reference );
             }
         }
-
         else
         {
             m_componentManager.log( LogService.LOG_DEBUG,
@@ -1064,8 +1063,10 @@
     boolean canUpdateDynamically( Dictionary properties )
     {
         // 1. no target filter change
-        final String targetFilter = ( String ) properties.get( m_dependencyMetadata.getTargetPropertyName()
);
-        if ( ( getTarget() == null && targetFilter == null ) || getTarget().equals(
targetFilter ) )
+        final String newTarget = ( String ) properties.get( m_dependencyMetadata.getTargetPropertyName()
);
+        final String currentTarget = getTarget();
+        if ( ( currentTarget == null && newTarget == null )
+            || ( currentTarget != null && currentTarget.equals( newTarget ) ) )
         {
             // can update if target filter is not changed, since there is
             // no change is service binding
@@ -1085,7 +1086,7 @@
         // invariant: target filter change + dynamic policy
 
         // 3. check target services matching the new filter
-        ServiceReference[] refs = getFrameworkServiceReferences( targetFilter );
+        ServiceReference[] refs = getFrameworkServiceReferences( newTarget );
         if ( refs != null && refs.length > 0 )
         {
             // can update since there is at least on service matching the



Mime
View raw message