Migrate from Micronaut Framework annotations to JSpecify

MSAL

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

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

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