In order to help my static code analysis, I have used the @CheckForNull -Annotation from spotbugs: edu.umd.cs.findbugs.annotations.CheckForNull
It has come to my awareness that this annotation though still working, is officially deprecated. What would you use in terms of best practice instead?
Best wishes Abegail
Searched google and forums, but cannot find an answer.
Answered here: What @Nullable to use in Java (as of 2023/JDK21)?
In brief:
The best choice for the
@Nullableand@NonNullannotation remains that of the Checker Framework. It is the de facto standard (import org.checkerframework.checker.nullness.qual...appears in 95k files on GitHub), is recognized by the widest variety of tools, is a superset of most other nullness annotations, and has a clear, standard semantics.