Update StoreTreeNode methods
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / OperationWithModification.java
index 363f2499e2d35f85001b1715fb1d2b5bcc6e28d3..fba41a63b28f1b174de83090a7e37ca7f3d252e8 100644 (file)
@@ -56,14 +56,12 @@ final class OperationWithModification {
      * view, one will we instantiated with specified version.
      */
     Optional<NormalizedNode<?, ?>> read(final PathArgument child, final Version version) {
-        final Optional<ModifiedNode> maybeChild = modification.getChild(child);
-        if (maybeChild.isPresent()) {
-            final ModifiedNode childNode = maybeChild.get();
-
+        final ModifiedNode childNode = modification.childByArg(child);
+        if (childNode != null) {
             Optional<? extends TreeNode> snapshot = childNode.getSnapshot();
             if (snapshot == null) {
                 // Snapshot is not present, force instantiation
-                snapshot = applyOperation.getChild(child).get().apply(childNode, childNode.getOriginal(), version);
+                snapshot = applyOperation.getChildByArg(child).apply(childNode, childNode.getOriginal(), version);
             }
 
             return snapshot.map(TreeNode::getData);
@@ -75,7 +73,7 @@ final class OperationWithModification {
         }
 
         if (snapshot.isPresent()) {
-            return snapshot.get().getChild(child).map(TreeNode::getData);
+            return snapshot.get().findChildByArg(child).map(TreeNode::getData);
         }
 
         return Optional.empty();