When running test compiler/loopopts/SplitIfSharedFastLockBehindCastPP with VM options -XX:+UnlockDiagnosticVMOptions -XX:DiagnoseSyncOnValueBasedClasses=1, the VM detects an attempt to synchronize on an instance of a java.lang.Integer:
# Internal Error (workspace/open/src/hotspot/share/runtime/synchronizer.cpp:485), pid=4003920, tid=4003946
# fatal error: Synchronizing on object 0x0000200000037ee8 of klass java.lang.Integer at SplitIfSharedFastLockBehindCastPP.test2(SplitIfSharedFastLockBehindCastPP.java:92)
#
# JRE version: Java(TM) SE Runtime Environment (23.0) (fastdebug build 23-internal-2024-02-15-2215338.frederic.parain.jdk)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-internal-2024-02-15-2215338.frederic.parain.jdk, mixed mode, sharing, compressed class ptrs, z gc, linux-aarch64)
# Problematic frame:
# V [libjvm.so+0x156e874] ObjectSynchronizer::handle_sync_on_value_based_class(Handle, JavaThread*)+0x904
java.lang.Integer is one of the classes to be migrated to be a value class in JEP 401 Preview, which would cause this test to fail even without the DiagnoseSyncOnValueBasedClasses diagnostic option.