Hi Gary,
On 2.12.2024 20:28, Gary D. Gregory wrote:
Just on the CP for one app tooling stack:
org.jetbrains.annotations.NotNull
org.jetbrains.annotations.Nullable
com.sun.istack.NotNull
com.sun.istack.Nullable
org.springframework.lang.NonNull
org.springframework.lang.Nullable
jakarta.annotation.Nonnull
jakarta.annotation.Nullable
javax.annotation.Nonnull
javax.annotation.Nullable
org.wildfly.common.annotation.NotNull
org.wildfly.common.annotation.Nullable
What a (sad) joke!
There are two types of nullability annotations:
* Those introduced by IDEs and tools to perform static analysis, like
the `javax/jakarta` and `org.jetbrains` annotations. See [1] for a
longer list.
* Those introduced as internal annotations by some projects, so they
don't depend on an external dependency. In your list `com.sun.istack`,
`org.springframework` and `org.wildfly` are of the second kind. As long
as developers prefer to use internal annotations instead of adding an
external dependency, the list of these annotations will only grow longer.
This is why I prefer to use an external dependency like JSpecify,
instead of creating yet-another set of annotations you need to configure
in your static analysis tool
Piotr
[1]
https://stackoverflow.com/questions/4963300/which-notnull-java-annotation-should-i-use