Files
openide/java/java-impl/resources/inspectionDescriptions/SynchronizeOnValueBasedClass.html
2025-02-05 04:43:28 +00:00

16 lines
500 B
HTML

<html>
<body>
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.
<p>
For example, <code>java.lang.Double</code> is annotated with <code>jdk.internal.ValueBased</code>, so the following code will
produce a compile-time warning:
</p>
<pre><code>
Double d = 20.0;
synchronized (d) { ... } // javac warning
</code></pre>
<!-- tooltip end -->
<p><small>New in 2021.1</small></p>
</body>
</html>