Closed
Description
All public APIs already document in their Javadoc whether they accept null
values as parameters and whether the may return null
. However, this information isn't currently machine-readable and therefore IDEs cannot assist developers that program against these APIs. This may lead to unexpected NullPointerExceptions
and leads to unnecessary casts and assertions when writing code in Kotlin because it differentiates between nullable and non-nullable types. Therefore, we should mark all our non-internal code with annotations that are interpreted by IDEs as well as the Kotlin compiler. Moreover, we should change our build to validate the consistency of these annotations.
Related Issues
- Clarify when returned values might be null #358
- Add nullability annotations to code base for better tooling assistance #741
Deliverables
- Mark nullability of parameters and return types using JSpecify annotations
- Set up build to use Error Prone and NullAway
Metadata
Metadata
Assignees
Type
Projects
Status
Todo