Update CursorAwareDataTree{Modification,Snapshot} API
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / DataTreeCandidates.java
index 840ceab47f680f63f4fc36ddaf3cc4140ea8f2d9..b933ce1e3e248d5e213c0f2cd891ca89024ba1ef 100644 (file)
@@ -82,11 +82,11 @@ public final class DataTreeCandidates {
             final DataTreeCandidate candidate) {
         final YangInstanceIdentifier candidatePath = candidate.getRootPath();
         if (candidatePath.isEmpty()) {
-            try (DataTreeModificationCursor cursor = modification.createCursor(candidatePath)) {
+            try (DataTreeModificationCursor cursor = modification.openCursor()) {
                 DataTreeCandidateNodes.applyRootToCursor(cursor, candidate.getRootNode());
             }
         } else {
-            try (DataTreeModificationCursor cursor = modification.createCursor(candidatePath.getParent())) {
+            try (DataTreeModificationCursor cursor = modification.openCursor(candidatePath.getParent()).get()) {
                 DataTreeCandidateNodes.applyRootedNodeToCursor(cursor, candidatePath, candidate.getRootNode());
             }
         }