Migrate users of Optional.get()
[yangtools.git] / data / yang-data-tree-api / src / main / java / org / opendaylight / yangtools / yang / data / tree / api / CursorAwareDataTreeSnapshot.java
index 930ff057c21f3546128d52dc646b1c34a615086b..f36f90887a274be748b0a27a2994c9bcc62cf12e 100644 (file)
@@ -34,7 +34,7 @@ public interface CursorAwareDataTreeSnapshot extends DataTreeSnapshot {
      * @throws IllegalStateException if there is another cursor currently open.
      */
     default DataTreeSnapshotCursor openCursor() {
-        return openCursor(YangInstanceIdentifier.empty()).get();
+        return openCursor(YangInstanceIdentifier.empty()).orElseThrow();
     }
 
     @Override