Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 90996109C5 for ; Sat, 26 Oct 2013 16:29:00 +0000 (UTC) Received: (qmail 27167 invoked by uid 500); 26 Oct 2013 16:28:57 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 26362 invoked by uid 500); 26 Oct 2013 16:28:45 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 26349 invoked by uid 99); 26 Oct 2013 16:28:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Oct 2013 16:28:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Oct 2013 16:28:37 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 93833238899C; Sat, 26 Oct 2013 16:28:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1536005 - /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java Date: Sat, 26 Oct 2013 16:28:17 -0000 To: commits@felix.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131026162817.93833238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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() ) ) {