Synchronization on an object initialized with a literal
synchronized blocks that lock on an object initialized with a literal.
String literals are interned and
Number literals can be allocated from a cache. Because of this, it is possible that some other part of the system, which uses an object initialized with the same literal, is actually holding a reference to the exact same object. This can create unexpected dead-lock situations, if the lock object was thought to be private.
Use the Warn on all possible literals option to report any synchronization on
Warn on all possible literals
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3