Migrate from Micrometer annotations to JSpecify

MSAL

Replace the io.micrometer.core.lang @Nullable and @NonNull annotations with their JSpecify equivalents, adding the JSpecify dependency where needed.

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

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 io.micrometer.core.lang.*ull*
  3. Move annotation to array type io.micrometer.core.lang.*ull*
  4. Change type io.micrometer.core.lang.Nullable to org.jspecify.annotations.Nullable
  5. Change type io.micrometer.core.lang.NonNull to org.jspecify.annotations.NonNull
  6. Move annotation to type instead of field
  7. Remove duplicate annotations