Migrate from Jakarta annotation API to JSpecify

MSAL

Replace the jakarta.annotation @Nullable and @Nonnull annotations with their JSpecify equivalents, adding the JSpecify dependency where needed.

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

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