Null pointer errors have caused countless issues over the decades. Some modern languages, including Kotlin and Hack, have tracked the possibility of null in their type systems from their inception, whereas others, such as C#, have retrofitted explicit nullability to address the problem. Java 8 introduced java.util.Optional<T>, but this is not a general-purpose substitute for nullable references.
We have developed a compiler plugin, Nullsafe, that extends Java’s type-system with nullness. Nullsafe is integrated into the core developer workflow at Meta, and a large-scale code transformation has made many millions of lines of production Java code compliant with the nullness-extended type system. This has led to a significant decrease (35% to 80%) in the relative volume of NullPointerException errors in production.