A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1862 below:

[java] New rule for MessageDigest.getInstance · Issue #1862 · pmd/pmd · GitHub

static MessageDigest INSTANCE = MessageDigest.getInstance("SHA-512");

INSTANCE.digest(...);

This is not thread-safe code. That is, one should not cache the MessageDigest.getInstance instance and reuse it multiple times between threads. Similar to the UnsynchronizedStaticFormatter check.

I was bit by this and that's why I'm suggesting it as a new check - it might help someone. :)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4