Infer
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
- Compose JSpecify best practices (intra-body nullability inference)
- Infer and add
@Nullableannotations
Recipes
- Add
@Nullableto a functional-interface return type argument fed a null-returning lambda - Add
@Nullableto array element types that can hold null - Add
@Nullableto collection and map type arguments that hold null elements - Add
@Nullableto fields that can hold null - Add
@Nullableto method parameters that can receive null - Add
@Nullableto methods that can return null - Add a
@Nullableupper bound to a pass-through type parameter fed a null-returning lambda - Infer Java
@Nullablereturn types from Kotlin call sites - Propagate
@Nullableacross override relationships - Upgrade a lazily-initialized
@Nullablefield to@MonotonicNonNull