Migrate users of Optional.get()
[yangtools.git] / data / yang-data-tree-spi / src / main / java / org / opendaylight / yangtools / yang / data / tree / spi / DataTreeCandidateNodes.java
index 7ab94e1857c282bba489d12c5529234cb6126c9a..6a584c8bfe4676422e7eb7ec9bcf412cee7d5c7c 100644 (file)
@@ -165,7 +165,7 @@ public final class DataTreeCandidateNodes {
                 // No-op
                 break;
             case WRITE:
-                cursor.write(node.getIdentifier(), node.getDataAfter().get());
+                cursor.write(node.getIdentifier(), node.getDataAfter().orElseThrow());
                 break;
             default:
                 throw new IllegalArgumentException("Unsupported modification " + node.getModificationType());
@@ -197,7 +197,7 @@ public final class DataTreeCandidateNodes {
                 // No-op
                 break;
             case WRITE:
-                cursor.write(rootPath.getLastPathArgument(), node.getDataAfter().get());
+                cursor.write(rootPath.getLastPathArgument(), node.getDataAfter().orElseThrow());
                 break;
             default:
                 throw new IllegalArgumentException("Unsupported modification " + node.getModificationType());
@@ -283,7 +283,7 @@ public final class DataTreeCandidateNodes {
                         // No-op
                         break;
                     case WRITE:
-                        cursor.write(node.getIdentifier(), node.getDataAfter().get());
+                        cursor.write(node.getIdentifier(), node.getDataAfter().orElseThrow());
                         break;
                     default:
                         throw new IllegalArgumentException("Unsupported modification " + node.getModificationType());