Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-504

HierarchicalConfiguration clear() method doesn't remove the node from its parent anymore in XML source

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8
    • 2.0
    • None
    • None

    Description

      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 :

      ConfigurationNode oldNode = configuration.getRootNode();
      oldNode.getParentNode().removeChild(oldNode);
      

      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.

      Attachments

        Activity

          People

            oheger Oliver Heger
            adrien.clerc Adrien CLERC
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: