Skip to content

Commit

Permalink
fix: remove unnecessary requirenonnull
Browse files Browse the repository at this point in the history
  • Loading branch information
xy-peng committed Aug 8, 2023
1 parent 7651861 commit 72aea7f
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;

public class DigestBillEntity {
private final DigestInputStream digestInputStream;
Expand All @@ -20,10 +19,8 @@ public DigestBillEntity(InputStream inputStream, String hashValue, HashType hash
}

private MessageDigest getMessageDigestInstance(HashType hashType) {
Objects.requireNonNull(hashType, "HashType must not be null");

String algorithm;
if (Objects.requireNonNull(hashType) == HashType.SHA1) {
if (hashType == HashType.SHA1) {
algorithm = "SHA-1";
} else {
algorithm = hashType.name();
Expand Down

0 comments on commit 72aea7f

Please sign in to comment.