Migrate from JetBrains annotations to JSpecify
MSALReplace the org.jetbrains.annotations @Nullable and @NotNull annotations with their JSpecify equivalents, adding the JSpecify dependency where needed.
org. openrewrite. java. jspecify. MigrateFromJetbrainsAnnotationsmod run . --recipe= org. openrewrite. java. jspecify. MigrateFromJetbrainsAnnotationsInstall 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.jetbrains.annotations.*ull* - Change type
org.jetbrains.annotations.Nullabletoorg.jspecify.annotations.Nullable - Change type
NotNulltoNonNull - Move annotation to type instead of field
- Remove duplicate annotations