Author: djencks
Date: Sat Oct 26 16:28:17 2013
New Revision: 1536005

URL: http://svn.apache.org/r1536005
Log:
FELIX-4293 Do not try to reconfigure based on CM_LOCATION_CHANGED events with 
null properties, although code does set the bundle location if null

Modified:
    
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java

Modified: 
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java?rev=1536005&r1=1536004&r2=1536005&view=diff
==============================================================================
--- 
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
 (original)
+++ 
felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
 Sat Oct 26 16:28:17 2013
@@ -315,6 +315,11 @@ public class ConfigurationSupport implem
                         //this sets the location to this component's bundle if 
not already set.  OK here
                         //since it used to be set to this bundle, ok to reset 
it
                         final ConfigurationInfo configInfo = 
getConfigurationInfo( pid, componentHolder, bundleContext );
+                        if (configInfo.getProps() == null)
+                        {
+                            throw new IllegalStateException("Existing 
Configuration with pid " + pid + 
+                                    " has had its properties set to null and 
location changed.  We expected a delete event first.");
+                        }
                         //this config was used on this component.  Does it 
still match?
                         if (!checkBundleLocation( 
configInfo.getBundleLocation(), bundleContext.getBundle() ))
                         {
@@ -333,6 +338,11 @@ public class ConfigurationSupport implem
                         //this sets the location to this component's bundle if 
not already set.  OK here
                         //because if it is set to this bundle we will use it.
                         final ConfigurationInfo configInfo = 
getConfigurationInfo( pid, componentHolder, bundleContext );
+                        if (configInfo.getProps() == null)
+                        {
+                            //location has been changed before any properties 
are set.  We don't care.  Wait for an updated event with the properties
+                            break;
+                        }
                         //this component was not configured with this config.  
Should it be now?
                         if ( checkBundleLocation( 
configInfo.getBundleLocation(), bundleContext.getBundle() ) )
                         {


Reply via email to