BUG-509: there is only one createRecursively() 94/7294/2
authorRobert Varga <rovarga@cisco.com>
Tue, 20 May 2014 14:25:33 +0000 (16:25 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Wed, 21 May 2014 15:21:02 +0000 (15:21 +0000)
The naming and exposure of two and three arugment variants made things
confusing -- let it be clear there is only one version.

Change-Id: If05620e99c2200ee10c1881de8eecd015f18eb9b
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/SchemaAwareApplyOperation.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/StoreMetadataNode.java

index c3c027340cf7274d395fe3028bf2477ff7f70822..620c00791ca3a338b862ac2cc755aacaba94a1b9 100644 (file)
@@ -358,7 +358,7 @@ abstract class SchemaAwareApplyOperation implements ModificationApplyOperation {
                 nodeVersion = subtreeVersion;
             }
 
-            final StoreMetadataNode newValueMeta = StoreMetadataNode.createRecursively(newValue, nodeVersion, nodeVersion);
+            final StoreMetadataNode newValueMeta = StoreMetadataNode.createRecursively(newValue, nodeVersion);
             if (!modification.hasAdditionalModifications()) {
                 return newValueMeta;
             }
index 60d701b467a9210b2bdb52ba3ec932dc2fd9926c..695a1f1dd3b2becd6088432ab153f220640c9ff9 100644 (file)
@@ -84,16 +84,16 @@ class StoreMetadataNode implements Immutable, Identifiable<PathArgument> {
     }
 
     public static final StoreMetadataNode createRecursively(final NormalizedNode<?, ?> node,
-            final UnsignedLong nodeVersion, final UnsignedLong subtreeVersion) {
-        Builder builder = builder(nodeVersion) //
-                .setSubtreeVersion(subtreeVersion) //
+            final UnsignedLong version) {
+        Builder builder = builder(version) //
+                .setSubtreeVersion(version) //
                 .setData(node);
         if (node instanceof NormalizedNodeContainer<?, ?, ?>) {
 
             @SuppressWarnings("unchecked")
             NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>> nodeContainer = (NormalizedNodeContainer<?, ?, NormalizedNode<?, ?>>) node;
             for (NormalizedNode<?, ?> subNode : nodeContainer.getValue()) {
-                builder.add(createRecursively(subNode, nodeVersion, subtreeVersion));
+                builder.add(createRecursively(subNode, version));
             }
         }
         return builder.build();
@@ -154,7 +154,4 @@ class StoreMetadataNode implements Immutable, Identifiable<PathArgument> {
         }
     }
 
-    public static StoreMetadataNode createRecursively(final NormalizedNode<?, ?> node, final UnsignedLong version) {
-        return createRecursively(node, version, version);
-    }
 }