commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1585195 - in /commons/proper/configuration/branches/immutableNodes/src: main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModelReferences.java
Date Sat, 05 Apr 2014 19:51:15 GMT
Author: oheger
Date: Sat Apr  5 19:51:14 2014
New Revision: 1585195

URL: http://svn.apache.org/r1585195
Log:
Removed InMemoryNodeModel.addReferences().

This method is now replaced by the mergeRoot() method.

Modified:
    commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
    commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModelReferences.java

Modified: commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java?rev=1585195&r1=1585194&r2=1585195&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
(original)
+++ commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
Sat Apr  5 19:51:14 2014
@@ -714,32 +714,6 @@ public class InMemoryNodeModel implement
     }
 
     /**
-     * Adds the specified reference information to this model. Calling this
-     * method associates all nodes in the passed in map with the corresponding
-     * reference data. The nodes stay connected to these references, even if
-     * they are replaced by update operations.
-     *
-     * @param references the map with reference information (can be <b>null</b>,
-     *        then this method has no effect)
-     */
-    public void addReferences(Map<ImmutableNode, ?> references)
-    {
-        if (references != null && !references.isEmpty())
-        {
-            boolean done;
-            do
-            {
-                TreeData current = structure.get();
-                ReferenceTracker newTracker =
-                        current.getReferenceTracker().addReferences(references);
-                done =
-                        structure.compareAndSet(current,
-                                current.updateReferenceTracker(newTracker));
-            } while (!done);
-        }
-    }
-
-    /**
      * Returns the current {@code TreeData} object. This object contains all
      * information about the current node structure.
      *

Modified: commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModelReferences.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModelReferences.java?rev=1585195&r1=1585194&r2=1585195&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModelReferences.java
(original)
+++ commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModelReferences.java
Sat Apr  5 19:51:14 2014
@@ -18,7 +18,6 @@ package org.apache.commons.configuration
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
 import java.util.Collection;
@@ -131,38 +130,6 @@ public class TestInMemoryNodeModelRefere
     }
 
     /**
-     * Helper method for checking addReferences() if no action should be
-     * performed.
-     *
-     * @param refs the map with references
-     */
-    private void checkAddReferencesNoOp(Map<ImmutableNode, ?> refs)
-    {
-        ReferenceNodeHandler handler = model.getReferenceNodeHandler();
-        model.addReferences(refs);
-        assertSame("Model was changed", handler,
-                model.getReferenceNodeHandler());
-    }
-
-    /**
-     * Tests whether addReferences() can handle null input.
-     */
-    @Test
-    public void testAddReferencesNull()
-    {
-        checkAddReferencesNoOp(null);
-    }
-
-    /**
-     * Tests addReferences() for an empty map.
-     */
-    @Test
-    public void testAddReferencesEmpty()
-    {
-        checkAddReferencesNoOp(new HashMap<ImmutableNode, Object>());
-    }
-
-    /**
      * Tests whether references can be queried after an update operation.
      */
     @Test



Mime
View raw message