Inconsistent parent nodes in HierarchicalConfiguration when using setRootNode()
-------------------------------------------------------------------------------

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


HierarchicalConfiguration allows setting a root node explicitly using either 
setRootNode() or setRoot(). The latter exists for backwards compatibility only 
and operates on the type HierarchicalConfiguration.Node rather than 
ConfigurationNode. To support a corresponding getRoot() method a new instance 
of HierarchicalConfiguration.Node is created, and the child nodes of the root 
node are added to it. Thus these nodes become child nodes of this new node.

If now addProperty() is called for adding new properties to the configuration, 
the nodes created for the new properties are added to the node passed to the 
setRootNode() method. So they have a different parent node than the existing 
nodes.

As long as only methods of the Configuration interface are used for querying or 
manipulating the configuration, this does not seem to have any strange effects. 
But when working with the nodes directly it is certainly confusing.


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

Reply via email to