Annotations @Nonnull and @Nullable are not specified with the level of detail that would be needed to make this a worthwhile new standard. Since more advanced approaches exist for many years, I suggest to coordinate with those parties having worked in this area.
Some issues with the existing annotations:
All experts that I talked to agree that nowadays only TYPE_USE annotations should be used for this purpose, as only those support a degree of annotating the code that will allow analysis tools to give qualified answers.
Even worse, an annotation without any @Target meta annotation will for some corner cases (relating to arrays) affect two locations simultaneously, which makes for a completely obscure pitfall.
It is commonly agreed, that at least one more annotation is needed for practical use: some defaulting annotation, like @NonNullByDefault
The most pressing issue in this area is the abundance of too many similar annotations. Adding one more set in jakarta only aggravates the problem.
Prior art that should be taken into consideration includes:
Annotations
@Nonnull
and@Nullable
are not specified with the level of detail that would be needed to make this a worthwhile new standard. Since more advanced approaches exist for many years, I suggest to coordinate with those parties having worked in this area.Some issues with the existing annotations:
TYPE_USE
annotations should be used for this purpose, as only those support a degree of annotating the code that will allow analysis tools to give qualified answers.@Target
meta annotation will for some corner cases (relating to arrays) affect two locations simultaneously, which makes for a completely obscure pitfall.@NonNullByDefault
The most pressing issue in this area is the abundance of too many similar annotations. Adding one more set in jakarta only aggravates the problem.
Prior art that should be taken into consideration includes: