Migrate callers of Optional#get 38/106338/2
authorOleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Thu, 1 Jun 2023 09:22:55 +0000 (11:22 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Wed, 7 Jun 2023 08:13:13 +0000 (08:13 +0000)
Replaced Optional#get with better Optional#orElseThrow.

JIRA: NETCONF-1045
Change-Id: Ib940e923d040b2d960a594b1c84f0e7403b602df
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
restconf/websocket-client/src/main/java/org/opendaylight/restconf/websocket/client/StartApplication.java

index 284990cecd3d8750826cad6fe21be35018af1fa5..9f3ca241c30710d3ae538d82b4ce9a227ff7080d 100644 (file)
@@ -58,7 +58,7 @@ public final class StartApplication {
                     .map(streamName -> getWebSocketClientHandler(applicationSettings, sslContextFactory,
                             scheduledExecutorService, streamName))
                     .filter(Optional::isPresent)
-                    .map(Optional::get)
+                    .map(Optional::orElseThrow)
                     .collect(Collectors.toList());
             printHandledStreamsOverview(applicationSettings.getStreams(), clientHandlers);
             startAndLockOnClientHandlers(scheduledExecutorService, clientHandlers);