Migrate users of Optional.get()
[openflowplugin.git] / applications / bulk-o-matic / src / main / java / org / opendaylight / openflowplugin / applications / bulk / o / matic / FlowWriterDirectOFRpc.java
index 7755fcf44cb1ab83536dccbffbb657b57bcfa7b0..1ac1db7564058c466822374e3da57050aabaa473 100644 (file)
@@ -77,7 +77,7 @@ public class FlowWriterDirectOFRpc {
         try (ReadTransaction readOnlyTransaction = dataBroker.newReadOnlyTransaction()) {
             Optional<Nodes> nodesDataNode = readOnlyTransaction.read(LogicalDatastoreType.OPERATIONAL, nodes).get();
             if (nodesDataNode.isPresent()) {
-                Collection<Node> nodesCollection = nodesDataNode.get().nonnullNode().values();
+                Collection<Node> nodesCollection = nodesDataNode.orElseThrow().nonnullNode().values();
                 if (!nodesCollection.isEmpty()) {
                     for (Node node : nodesCollection) {
                         LOG.info("Switch with ID {} discovered !!", node.getId().getValue());