Move annotation to array type
MSALWhen an annotation like @Nullable is applied to an array type in declaration position, this recipe moves it to the array brackets. For example, @Nullable byte[] becomes byte @Nullable[]. Best used before ChangeType in a migration pipeline, targeting the pre-migration annotation type.
org. openrewrite. java. migrate. jspecify. MoveAnnotationToArrayTypeRequired
The type of annotation to move to the array type. Should target the pre-migration annotation type to avoid changing the semantics of pre-existing type-use annotations on object arrays.
mod run . --recipe= org. openrewrite. java. migrate. jspecify. MoveAnnotationToArrayType \
-P annotationType= 'javax. annotation. *ull*'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.