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:48:45 UTC

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

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.1, configadmin-1.0.0
            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.


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

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed FELIX-611.
-----------------------------------


Deployed snapshot version 1.0.2-20080806.083202-1.

Closing this now.

> 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.4
>
>
> 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.


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

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-611.
-------------------------------------

    Resolution: Fixed

Committed the following fixes in Rev. 683144:

(1) Don't return configurations from listConfiguration, which have no properties set (yet).
(2) Return null from listConfiguration instead of empty array in case no applicable configurations can be found

Deffering closing this issue until deploying a new snapshot

> 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.


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

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ 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.