Add @Nullable to fields that can hold null
ProprietaryAdds the JSpecify @Nullable annotation to a Java field when that field is provably assigned a nullable value anywhere in the project: a declaration initializer or an assignment (f = expr, this.f = expr, or obj.f = expr) whose value is the null literal (directly, through a cast or parentheses, or via either branch of a ternary) or a call to a nullable-returning method. Nullability propagates from every assignment site to the field's declaration across the project, preparing the code for NullAway. Conservative by design: it skips primitive fields, final fields with a non-null initializer, record components, fields already annotated, and fields with a dependency-injection annotation (@Inject, @Autowired, @Resource, @Mock, @Value, @Bean). Only Java fields are modified.
io. moderne. nullability. AddNullableToFieldmod run . --recipe= io. moderne. nullability. AddNullableToFieldInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.