Migrate from Spring Framework annotations to JSpecify

MSAL

Replace the org.springframework.lang @Nullable and @NonNull annotations with their JSpecify equivalents, adding the JSpecify dependency where needed.

org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations
mod run . --recipe=org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations

Install 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.

  1. Add Gradle or Maven dependency org.jspecify:jspecify:1.0.0
  2. Remove annotation from void method org.springframework.lang.*ull*
  3. Move annotation to array type org.springframework.lang.*ull*
  4. Change type org.springframework.lang.Nullable to org.jspecify.annotations.Nullable
  5. Change type org.springframework.lang.NonNull to org.jspecify.annotations.NonNull
  6. Move annotation to type instead of field
  7. Remove duplicate annotations