New JEP: Warnings for Identity-Sensitive Libraries

John Rose john.r.rose at oracle.com
Thu Jan 30 21:44:39 UTC 2025


That’s very nicely framed.  Not too much at first,
with room to grow if we like what we get at first.

On 30 Jan 2025, at 12:39, Dan Smith wrote:

> I've created a small JEP as a follow-up to JEP 390 (Warnings for Value-Based Classes, delivered in 16).
>
> https://bugs.openjdk.org/browse/JDK-8340476
>
> JEP 390 introduced javac warnings about synchronization attempts on value-based classes (including the wrapper classes), which will become errors when synchronizing on a value object. This JEP produces similar warnings for uses of identity-sensitive libraries with value-based classes, which will throw exceptions when operating on value objects.
>
> (JEP 390 also had a HotSpot diagnostic for the 'monitorenter' instruction, which we don't have an analog for here, because it didn't seem worthwhile, and we don't really have a mechanism for library diagnostics.)
>
> This JEP doesn't depend on value classes or other big features, so I'm envisioning getting it into the 25 release.


More information about the valhalla-spec-experts mailing list