Compose JSpecify best practices (intra-body nullability inference)

Proprietary

Run the OpenRewrite static-analysis inference recipes that derive nullability from signals inside each method body: methods whose bodies can return null (standard-library aware, e.g. Map.get/Queue.poll) and parameters with an explicit accepting null branch, emitting JSpecify @Nullable. Complements the cross-file inference recipes.

io.moderne.nullability.ComposeJSpecifyBestPractices
mod run . --recipe=io.moderne.nullability.ComposeJSpecifyBestPractices

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. Annotate methods which may return null with @Nullable
  2. Add @Nullable to parameters with an accepting null branch