Skip to content

Commit 3446b67

Browse files
authored
Merge pull request #2088 from AetherRadar/fix-optional-redundancy
Fix redundant Optional check in DefaultHashService
2 parents ab614ec + 34f6e25 commit 3446b67

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crypto/hash/src/main/java/org/apache/shiro/crypto/hash/DefaultHashService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package org.apache.shiro.crypto.hash;
2020

2121
import java.security.SecureRandom;
22-
import java.util.NoSuchElementException;
2322
import java.util.Optional;
2423
import java.util.Random;
2524

@@ -90,7 +89,7 @@ public Hash computeHash(HashRequest request) {
9089

9190
Optional<HashSpi> kdfHash = HashProvider.getByAlgorithmName(algorithmName);
9291
if (kdfHash.isPresent()) {
93-
HashSpi hashSpi = kdfHash.orElseThrow(NoSuchElementException::new);
92+
HashSpi hashSpi = kdfHash.get();
9493

9594
return hashSpi.newHashFactory(random).generate(request);
9695
}

0 commit comments

Comments
 (0)