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

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: