Closed TheMode closed 3 years ago
There's already @jdk.internal.ValueBased
annotation that is used in JDK for this purpose.
As the name indicates, isn't it strictly internal?
Yes, currently it is. But this may change in the future, and we don't want to repeat JDK annotation.
A new annotation giving a warning when an instance is used as a monitor. As specified in
PrimitiveObject
documentation https://github.com/openjdk/valhalla/blob/lworld/src/java.base/share/classes/java/lang/PrimitiveObject.java#L51It could also be used to discourage users from using the object monitor directly (in the case where it is used internally)