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 developers eliminate NullPointerExceptions (NPEs) by performing compile-time checks based on @Nullable annotations. It identifies potential null dereferences and ensures proper null handling, similar to null-safety features in Kotlin and Swift. 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 runtime null pointer errors. It's particularly valuable for projects adopting gradual null-safety or migrating from unannotated codebases.
Developers choose NullAway for its exceptional balance of effectiveness and performance—it catches most production NPEs while adding less than 10% build overhead. Unlike more comprehensive but heavier solutions, it provides practical null-safety with minimal annotation burden and seamless integration into existing Java toolchains.
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.
Adds typically less than 10% overhead to builds by running as an Error Prone plugin, enabling frequent checks without significant slowdown, as stated in the README.
Works with multiple @Nullable annotation libraries like JSpecify, AndroidX, or JetBrains, allowing teams to use their preferred tools without vendor lock-in.
Supports configurable package scoping to check specific packages, making it easy to incrementally add null-safety to large existing codebases, as highlighted in the features.
Catches most common NullPointerExceptions observed in production, offering high value with reasonable annotation effort, aligning with its philosophy of practicality.
Does not prevent all possible NPEs, as it focuses on common cases and may miss edge scenarios, unlike more exhaustive tools like the Checker Framework.
Requires manual configuration to handle code from annotation processors like Dagger, and has issues with Lombok, adding setup complexity and potential build errors.
Mandates JDK 17 or higher and integration with Error Prone, which may not be feasible for legacy projects or those using incompatible build tools.