A fast, annotation-based null checker for Java that eliminates NullPointerExceptions with low build-time overhead.
NullAway is a static analysis tool for Java that helps eliminate NullPointerExceptions (NPEs) by performing type-based nullability checks. It requires developers to annotate potentially null fields, parameters, and return values with `@Nullable`, then analyzes code to ensure safe dereferencing. The tool integrates with Error Prone and runs during builds with minimal performance impact.
Java developers and teams building large-scale applications who want to improve code reliability by preventing null pointer errors. It's particularly valuable for projects where NPEs are a common production issue.
Developers choose NullAway because it offers a practical balance between null-safety coverage and performance, with typically less than 10% build-time overhead. Unlike more comprehensive but slower alternatives, it focuses on catching the most common NPEs while maintaining fast build times.
A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Runs as an Error Prone plugin with typically less than 10% build-time overhead, ensuring minimal impact on development speed and CI pipelines.
Works with multiple @Nullable annotation sources like JSpecify, AndroidX, and JetBrains, allowing teams to use their preferred libraries without lock-in.
Catches most production-observed NullPointerExceptions without attempting to prevent all possible errors, offering a high return on annotation effort as stated in the README.
Allows checking specific packages via configuration (e.g., AnnotatedPackages), helping manage the annotation burden in large or legacy codebases.
Admits it does not prevent all possible NPEs, meaning some null errors might still slip through in edge cases, which is a trade-off for its speed.
Requires integration with Error Prone, JDK 17+, and specific configuration for tools like Lombok or Dagger, which can be challenging and error-prone for new users.
Developers must manually add @Nullable annotations throughout the codebase, which is time-consuming and can lead to missed spots in large projects.