SYSTEM Cited by 1 source
Nullsafe (Meta / Infer)¶
Nullsafe is Meta's static-analysis tool for Java
null-safety. Ships as part of the Infer-adjacent annotation
set. Source:
github.com/facebook/infer/blob/main/infer/annotations/src/main/java/com/facebook/infer/annotation/Nullsafe.java.
The @Nullsafe class-level annotation opts the class into
Nullsafe's static-analysis rules.
Role in the wiki¶
Nullsafe is the Java-side null-safety prerequisite for
Meta's Java→Kotlin translation pipeline. Before the
Kotlinator can safely translate a file,
the file (and ideally its dependents) must be @Nullsafe so
that the Kotlinator can infer accurate nullability for
parameters, return types, and fields.
The fundamental limitation Meta calls out¶
The 2024-12-18 post is explicit about why Nullsafe alone is
insufficient to eliminate NPEs: "[static analysis is only
100% effective for 100% code coverage], which is simply not
viable in any large mobile codebase that interacts with the
server and third-party libraries." A single non-@Nullsafe
dependent can pass null into a @Nullsafe-protected method
and crash the caller. This is the wiki's
interlanguage null
safety problem.
The solution Meta pursues: runtime nullability telemetry via a javac compiler plugin that collects actual null flows. See concepts/runtime-nullability-telemetry.
Seen in¶
- sources/2024-12-18-meta-translating-10m-lines-of-java-to-kotlin — Nullsafe as the Java prerequisite for Kotlin translation.
Related¶
- systems/nullaway — Uber's sibling tool, named alongside Nullsafe in the Meta post.
- systems/javac-plugin — the runtime-telemetry solution Meta layers on top of Nullsafe.
- concepts/interlanguage-null-safety — the load-bearing concept.
- concepts/runtime-nullability-telemetry — the dynamic counterpart.