-
Notifications
You must be signed in to change notification settings - Fork 369
Home
Vladimir Sitnikov edited this page Sep 5, 2026
·
12 revisions
NullAway is a tool to help eliminate NullPointerExceptions in Java code, built as a plugin to Error Prone so that it runs on every build. The README covers what NullAway is and how to add it to a Gradle build.
- Installation covers the Gradle setup and the annotations to depend on.
- Compatibility states which JDK and Error Prone versions each NullAway version needs, and the combinations that do not work.
- Adopting NullAway gives the order to switch an existing codebase on, and the two migrations that come later.
- Configuration lists every command-line flag, and shows how to wire NullAway into Maven, Bazel, and other build systems.
-
Suppressing Warnings covers
@SuppressWarnings,castToNonNull, and auto-suppressing the warnings an existing codebase starts with.
-
Supported Annotations lists the
@Nullable,@Initializer,@Contract, and field-contract annotations NullAway reads. - JSpecify Support covers JSpecify annotations, JSpecify mode for generics, and the two optional Error Prone checks NullAway ships.
- Error Messages explains every message NullAway emits, what causes it, and how to fix it.
- Deliberate Unsoundness lists the null dereferences NullAway knowingly does not catch, and why.
-
Maps explains what NullAway concludes from
containsKey,get, andput. -
Stream Handling covers nullness through
filter, and through callbacks injava.util.streamand RxJava.
- How NullAway Works describes the dataflow analysis, the handler mechanism, and the JSpecify implementation.
Getting NullAway running
Writing the annotations
When NullAway reports something
Internals