felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r683144 - in /felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl: ConfigurationAdminImpl.java ConfigurationImpl.java ConfigurationManager.java
Date Wed, 06 Aug 2008 07:41:49 GMT
Author: fmeschbe
Date: Wed Aug  6 00:41:48 2008
New Revision: 683144

URL: http://svn.apache.org/viewvc?rev=683144&view=rev
Log:
FELIX-611 Do not return new configurations from the ConfigurationAdmin.listConfiguration
method and return null in case listConfiguration found no applicable configurations at all
(mandated by the spec, that null be returned and not an empty array)

Modified:
    felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java
    felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationImpl.java
    felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java

Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java?rev=683144&r1=683143&r2=683144&view=diff
==============================================================================
--- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java
(original)
+++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationAdminImpl.java
Wed Aug  6 00:41:48 2008
@@ -125,7 +125,7 @@
     public Configuration[] listConfigurations( String filter ) throws IOException, InvalidSyntaxException
     {
         ConfigurationImpl ci[] = configurationManager.listConfigurations( this, filter );
-        if ( ci == null )
+        if ( ci == null || ci.length == 0 )
         {
             return null;
         }

Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationImpl.java?rev=683144&r1=683143&r2=683144&view=diff
==============================================================================
--- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationImpl.java
(original)
+++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationImpl.java
Wed Aug  6 00:41:48 2008
@@ -378,6 +378,12 @@
     }
 
 
+    /**
+     * Returns <code>false</code> if this configuration contains configuration
+     * properties. Otherwise <code>true</code> is returned and this is a
+     * newly creted configuration object whose {@link #update(Dictionary)}
+     * method has never been called.
+     */
     boolean isNew()
     {
         return properties == null;

Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java?rev=683144&r1=683143&r2=683144&view=diff
==============================================================================
--- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
(original)
+++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
Wed Aug  6 00:41:48 2008
@@ -422,7 +422,11 @@
                         cfg = new ConfigurationImpl( this, pmList[i], config );
                     }
 
-                    configList.add( cfg );
+                    // FELIX-611: Ignore configuration objects without props
+                    if ( !cfg.isNew() )
+                    {
+                        configList.add( cfg );
+                    }
                 }
             }
         }



Mime
View raw message