appendix A Static analysis annotations
To make static analysis more efficient, it’s useful to augment your Java program with additional hints. This is usually done via a special set of annotations distributed as a separate package. Throughout the book, we mentioned some of them. Notably, we discussed many nullity annotations, like @Nullable
, in chapter 5. Here, I’d like to provide an overview of popular annotation packages and describe some commonly used annotations, so you may have a better idea about how they can help to reduce mistakes in your application.
Note that even some standard Java annotations may allow you to tailor static analysis to your API to some extent. The simplest is the @Deprecated
annotation, available in JDK, which ...
Get 100 Java Mistakes and How to Avoid Them now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.