rewrite-static-analysis
rewrite-static-analysis copied to clipboard
Recipe to remove @NonNull from primitive fields
import lombok.NonNull;
class Foo {
@NonNull
boolean bar;
}
This should be fixed to
class Foo {
boolean bar;
}
Support all https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
After https://github.com/openrewrite/rewrite/issues/2838 has been resolved, we could rely on "known" non-null and nullable annotations defined in KnownNullabilityAnnotations.java.
In addition, I propose we widen the scope of this recipe to "Remove nullability annotations from primitive fields" to include nullable annotations as well.