Use Optional.isEmpty().

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2021-07-01 10:51:34 -04:00
1 parent 49c43a6816
commit 49adcca80e
1 file changed
+2 -2
@@ -53,14 +53,14 @@ public class BaseAccountAuthenticator {
AuthorizationHeader authorizationHeader = AuthorizationHeader.fromUserAndPassword(basicCredentials.getUsername(), basicCredentials.getPassword());
Optional<Account> account = accountsManager.get(authorizationHeader.getIdentifier());
if (!account.isPresent()) {
if (account.isEmpty()) {
failureReason = "noSuchAccount";
return Optional.empty();
}
Optional<Device> device = account.get().getDevice(authorizationHeader.getDeviceId());
if (!device.isPresent()) {
if (device.isEmpty()) {
failureReason = "noSuchDevice";
return Optional.empty();
}