Apparently "the copied nodes still contain a reference to their old configuration (because you directly fetched them from the root node of the source configuration). Because of this reference they are not detected as new nodes when the destination configuration is saved, and hence not written to disk.

I think addNodes() should reset this reference, so that the added nodes can be detected as new nodes. (But then you have to be aware that you break the source configuration because a node can only be contained in exactly one configuration.) "

Activity

HierarchicalConfiguration.addNodes() now resets the references of the added nodes. This allows XMLConfiguration to detect the affected nodes as new, and they are correctly saved. I also added a note to the Javadocs of addNodes() about directly copying nodes from one configuration to another one.

Oliver Heger
added a comment - 26/Jul/07 20:17 HierarchicalConfiguration.addNodes() now resets the references of the added nodes. This allows XMLConfiguration to detect the affected nodes as new, and they are correctly saved. I also added a note to the Javadocs of addNodes() about directly copying nodes from one configuration to another one.