JDK-8262495 : Release Note: JEP 390: Warnings for Value-based Classes
  • Type: Sub-task
  • Component: core-libs
  • Affected Version: 16
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2021-02-27
  • Updated: 2021-12-10
  • Resolved: 2021-12-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16Resolved
Description
Users of the _value-based classes_ provided by the standard libraries—notably including users of the primitive wrapper classes—should avoid relying on the identity of class instances. Programmers are strongly discouraged from calling the wrapper class constructors, which are now deprecated for removal. New `javac` warnings discourage synchronization on value-based class instances. Runtime warnings about synchronization can also be activated, using command-line option `-XX:DiagnoseSyncOnValueBasedClasses`.

For further details, see [JEP 390](https://openjdk.java.net/jeps/390).