commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CONFIGURATION-458) SubnodeConfiguration.clear() does not work correctly
Date Mon, 01 Aug 2011 20:03:09 GMT
SubnodeConfiguration.clear() does not work correctly
----------------------------------------------------

                 Key: CONFIGURATION-458
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-458
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 1.6
            Reporter: Oliver Heger


If clear() is called on a SubnodeConfiguration obtained through the configurationAt() method
of HierarchicalConfiguration, the node structure of the parent configuration (outside of the
area of the sub configuration) may also be manipulated. Properties added to the SubnodeConfiguration
after a clear() are not visible from the parent configuration.

The problem is caused by the implementation of the clear() method inherited from AbstractConfiguration.
This will call clearProperty() for each property found in the configuration. clearProperty()
in turn clears the value of nodes and recursively clears the parent node if it does not contain
any data. Here the structure owned by the SubnodeConfiguration can be left so that the parent
gets manipulated.

A possible solution would be to provide a specific implementation of clear() for hierarchical
configurations. This could also be more efficient than the base implementation.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message