Update StoreTreeNode methods
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / InMemoryDataTreeModification.java
index a34614d074e57a0c68f23e8b20c92a536b7fa3a4..6f0d92d25174e65d5f60f814d1371cc3dcb6ad91 100644 (file)
@@ -177,12 +177,11 @@ final class InMemoryDataTreeModification extends AbstractCursorAware implements
 
         int depth = 1;
         for (final PathArgument pathArg : path.getPathArguments()) {
-            final Optional<ModificationApplyOperation> potential = operation.getChild(pathArg);
-            if (!potential.isPresent()) {
+            operation = operation.childByArg(pathArg);
+            if (operation == null) {
                 throw new SchemaValidationFailedException(String.format("Child %s is not present in schema tree.",
                         path.getAncestor(depth)));
             }
-            operation = potential.get();
             ++depth;
 
             modification = modification.modifyChild(pathArg, operation, version);