Inspectopedia Help

Value-based warnings

Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16.

For example, java.lang.Double is annotated with jdk.internal.ValueBased, so the following code will produce a compile-time warning:

Double d = 20.0; synchronized (d) { ... } // javac warning

New in 2021.1

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023