Migrate from Spring Framework annotations to JSpecify
MSALReplace the org.springframework.lang @Nullable and @NonNull annotations with their JSpecify equivalents, adding the JSpecify dependency where needed.
org. openrewrite. java. jspecify. MigrateFromSpringFrameworkAnnotationsmod run . --recipe= org. openrewrite. java. jspecify. MigrateFromSpringFrameworkAnnotationsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Add Gradle or Maven dependency
org.jspecify:jspecify:1.0.0 - Remove annotation from
voidmethodorg.springframework.lang.*ull* - Move annotation to array type
org.springframework.lang.*ull* - Change type
org.springframework.lang.Nullabletoorg.jspecify.annotations.Nullable - Change type
org.springframework.lang.NonNulltoorg.jspecify.annotations.NonNull - Move annotation to type instead of field
- Remove duplicate annotations