You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2008/06/18 14:50:44 UTC

[jira] Commented: (FELIX-611) ConfigurationAdmin.listConfigurations returns empty configurations

    [ https://issues.apache.org/jira/browse/FELIX-611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605927#action_12605927 ] 

Felix Meschberger commented on FELIX-611:
-----------------------------------------

The fix is probably rather easy with this potential patch:

Index: /usr/src/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
===================================================================
--- /usr/src/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java	(revision 667421)
+++ /usr/src/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java	(working copy)
@@ -422,7 +422,11 @@
                         cfg = new ConfigurationImpl( this, pmList[i], config );
                     }
 
-                    configList.add( cfg );
+                    // FELIX-611: Ignore configuration objects without props
+                    if ( cfg.getProperties() != null )
+                    {
+                        configList.add( cfg );
+                    }
                 }
             }
         }


This is still to be tested....

> ConfigurationAdmin.listConfigurations returns empty configurations
> ------------------------------------------------------------------
>
>                 Key: FELIX-611
>                 URL: https://issues.apache.org/jira/browse/FELIX-611
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>    Affects Versions: configadmin-1.0.0, configadmin-1.0.1
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: configadmin-1.0.2
>
>
> The current implementation of the ConfigurationAdmin.listConfigurations method returns all matching configurations even those with no properties.
> On the other hand the specification of the listConfigurations method states:
>     Only Configuration objects with non- null properties are considered cur-
>     rent. That is, Configuration.getProperties() is guaranteed not to return null
>     for each of the returned Configuration objects.
> Configuration.getProperties() may return null on newly created configuration objects which never have been updated with actual configuration such as Configuration objects created upon calling ConfigurationAdmin.getConfiguration(String)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.