Skip to content

Commit

Permalink
Trigger a violation...
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Apr 8, 2023
1 parent 539e0af commit 512648b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import com.sun.source.tree.Tree;
import com.sun.source.tree.VariableTree;
import com.sun.tools.javac.code.Symbol;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Optional;
import tech.picnic.errorprone.bugpatterns.util.MoreASTHelpers;
Expand Down Expand Up @@ -89,6 +92,11 @@ public Description matchBlock(BlockTree tree, VisitorState state) {
.orElse(Description.NO_MATCH);
}

private static byte[] md5Hash(String s) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
return md.digest(s.getBytes(StandardCharsets.UTF_8));
}

private static Optional<ExpressionTree> tryMatchAssignment(Symbol targetSymbol, Tree tree) {
if (tree instanceof ExpressionStatementTree) {
return tryMatchAssignment(targetSymbol, ((ExpressionStatementTree) tree).getExpression());
Expand Down

0 comments on commit 512648b

Please sign in to comment.