We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ab614ec + 34f6e25 commit 3446b67Copy full SHA for 3446b67
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/DefaultHashService.java
@@ -19,7 +19,6 @@
19
package org.apache.shiro.crypto.hash;
20
21
import java.security.SecureRandom;
22
-import java.util.NoSuchElementException;
23
import java.util.Optional;
24
import java.util.Random;
25
@@ -90,7 +89,7 @@ public Hash computeHash(HashRequest request) {
90
89
91
Optional<HashSpi> kdfHash = HashProvider.getByAlgorithmName(algorithmName);
92
if (kdfHash.isPresent()) {
93
- HashSpi hashSpi = kdfHash.orElseThrow(NoSuchElementException::new);
+ HashSpi hashSpi = kdfHash.get();
94
95
return hashSpi.newHashFactory(random).generate(request);
96
}
0 commit comments