JetBrains / java-annotations

Annotations for JVM-based languages.
Apache License 2.0
404 stars 47 forks source link

@ValueType annotation in preparation for Valhalla #57

Closed TheMode closed 3 years ago

TheMode commented 3 years ago

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#L51

It could also be used to discourage users from using the object monitor directly (in the case where it is used internally)

amaembo commented 3 years ago

There's already @jdk.internal.ValueBased annotation that is used in JDK for this purpose.

TheMode commented 3 years ago

As the name indicates, isn't it strictly internal?

amaembo commented 3 years ago

Yes, currently it is. But this may change in the future, and we don't want to repeat JDK annotation.