nodeId, NetworkUtils.OVERLAY_NETWORK_ID);
return null;
}
- return optionalNode.get();
+ return optionalNode.orElseThrow();
} catch (ExecutionException | TimeoutException e) {
LOG.warn("Exception while getting network node for node id {} from {} topology",
nodeId, NetworkUtils.OVERLAY_NETWORK_ID, e);
nodeId, NetworkUtils.OVERLAY_NETWORK_ID);
return null;
}
- return optionalNode.get();
+ return optionalNode.orElseThrow();
} catch (ExecutionException | TimeoutException e) {
LOG.warn("Exception while getting common network node for node id {} from {} topology",
nodeId, NetworkUtils.OVERLAY_NETWORK_ID, e);
Optional<TerminationPoint1> optionalTerminationPoint = readTx
.read(LogicalDatastoreType.CONFIGURATION, tpIID)
.get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
- return optionalTerminationPoint.isEmpty() ? null : optionalTerminationPoint.get();
+ return optionalTerminationPoint.isEmpty() ? null : optionalTerminationPoint.orElseThrow();
} catch (ExecutionException | TimeoutException e) {
LOG.warn("Exception while getting termination {} for node id {} point from {} topology",
tpId, nodeId, NetworkUtils.OVERLAY_NETWORK_ID, e);
tpId, nodeId, NetworkUtils.OVERLAY_NETWORK_ID);
return null;
}
- return optionalTerminationPoint.get();
+ return optionalTerminationPoint.orElseThrow();
} catch (ExecutionException | TimeoutException e) {
LOG.warn("Exception while getting common-network termination {} for node id {} point from {} topology",
tpId, nodeId, NetworkUtils.OVERLAY_NETWORK_ID, e);