Migrate callers of Optional.get()
[aaa.git] / aaa-cli-jar / src / main / java / org / opendaylight / aaa / cli / jar / StandaloneCommandLineInterface.java
index 01475df4b927edb725176c284f9a6bc48e6d7dd5..3b85ca6e04f45aaf8a7a9752ebd8ed8253a5629c 100644 (file)
@@ -62,7 +62,7 @@ public class StandaloneCommandLineInterface {
         if (!optUser.isPresent()) {
             return false;
         } else {
-            User user = optUser.get();
+            User user = optUser.orElseThrow();
             user.setPassword(newPassword);
             identityStore.updateUser(user);
             return true;
@@ -78,7 +78,7 @@ public class StandaloneCommandLineInterface {
         if (!optUser.isPresent()) {
             return false;
         } else {
-            User user = optUser.get();
+            User user = optUser.orElseThrow();
             return passwordService.passwordsMatch(password, user.getPassword(), user.getSalt());
         }
     }