commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r657959 - /commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
Date Mon, 19 May 2008 20:25:32 GMT
Author: oheger
Date: Mon May 19 13:25:31 2008
New Revision: 657959

URL: http://svn.apache.org/viewvc?rev=657959&view=rev
Log:
Removed duplicate code

Modified:
    commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java

Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java?rev=657959&r1=657958&r2=657959&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/HierarchicalConfiguration.java
Mon May 19 13:25:31 2008
@@ -417,16 +417,6 @@
                     "Cannot add nodes to an attribute node!");
         }
 
-        // a visitor to ensure that the nodes' references are cleared; this is
-        // necessary if the nodes are moved from another configuration
-        ConfigurationNodeVisitor clearRefVisitor = new ConfigurationNodeVisitorAdapter()
-        {
-            public void visitBeforeChildren(ConfigurationNode node)
-            {
-                node.setReference(null);
-            }
-        };
-
         for (Iterator it = nodes.iterator(); it.hasNext();)
         {
             ConfigurationNode child = (ConfigurationNode) it.next();
@@ -438,7 +428,7 @@
             {
                 parent.addChild(child);
             }
-            child.visit(clearRefVisitor);
+            clearReferences(child);
         }
         fireEvent(EVENT_ADD_NODES, key, nodes, false);
     }



Mime
View raw message