commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien CLERC (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CONFIGURATION-504) HierarchicalConfiguration clear() method doesn't remove the node from its parent anymore in XML source
Date Mon, 17 Sep 2012 07:23:07 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456853#comment-13456853
] 

Adrien CLERC commented on CONFIGURATION-504:
--------------------------------------------

Maybe the {{clear()}} method should stay as it is now, with an explicit mention on its exact
behavior in the documentation.
For the old behavior, it should be better to create a {{remove()}} or {{removeFromParent()}}
method that will be more explicit on its purpose.

What do you think of this?
                
> HierarchicalConfiguration clear() method doesn't remove the node from its parent anymore
in XML source
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-504
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-504
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.8
>            Reporter: Adrien CLERC
>            Priority: Minor
>
> Using an XML source file, I used to call HierarchicalConfiguration.clear() on an object
to remove it from its parent. Now, it just clear the text and the subnodes, but not the node
itself, nor its own attribute, when the file is saved.
> Here is the code that works :
> {code}
> ConfigurationNode oldNode = configuration.getRootNode();
> oldNode.getParentNode().removeChild(oldNode);
> {code}
> configuration belong to a list of HierarchicalConfiguration that I obtained from configurationsAt.
I didn't see any other way to remove a node I got from that method, without explicit casting
to SubnodeConfiguration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message