Migrate users of Optional.get()
[ovsdb.git] / southbound / southbound-impl / src / main / java / org / opendaylight / ovsdb / southbound / ovsdb / transact / AutoAttachUpdateCommand.java
index a7e0f6f8b9321d585795a1fd8ac3b4bda0b379fa..d753b46169f4940cb0be17c4c9553e73b3ca324b 100644 (file)
@@ -92,7 +92,7 @@ public class AutoAttachUpdateCommand implements TransactCommand {
             }
 
             final OvsdbNodeAugmentation currentOvsdbNode =
-                    state.getBridgeNode(iid).get().augmentation(OvsdbNodeAugmentation.class);
+                    state.getBridgeNode(iid).orElseThrow().augmentation(OvsdbNodeAugmentation.class);
             final Map<AutoattachKey, Autoattach> currentAutoAttach = currentOvsdbNode.getAutoattach();
             for (final Autoattach autoAttach : autoAttachList.values()) {
                 final AutoAttach autoAttachWrapper = transaction.getTypedRowWrapper(AutoAttach.class);
@@ -177,7 +177,7 @@ public class AutoAttachUpdateCommand implements TransactCommand {
             final Optional<OvsdbBridgeAugmentation> bridgeOptional =
                     transaction.read(LogicalDatastoreType.OPERATIONAL, bridgeIid).get();
             if (bridgeOptional.isPresent()) {
-                bridge = bridgeOptional.get();
+                bridge = bridgeOptional.orElseThrow();
             }
         } catch (InterruptedException | ExecutionException e) {
             LOG.warn("Error reading from datastore", e);