← All recipes
Moderne licensed

Add @NullMarked to every package

Recipe IDio.moderne.nullability.AddNullMarkedToAllPackages
Artifactio.moderne.recipe:rewrite-nullability

Brings a whole repository into JSpecify checked scope: generates a bare package-info.java for any package that has Java sources but lacks one, then adds the @NullMarked annotation to every package-info.java (existing or generated). Unconditional — intended to run first in the NullSafety recipe so the inference and repair recipes that follow treat the entire project as checked scope and fix whatever marking exposes. The default package, packages explicitly @NullUnmarked, and generated sources (a /generated/ path or a @Generated class) are skipped. Idempotent and Java only.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe io.moderne.nullability.AddNullMarkedToAllPackages

If the recipe isn’t available locally, install it with:

mod config recipes jar install io.moderne.recipe:rewrite-nullability:0.3.1

Data tables

Structured output this recipe can produce.

  • Source files that had resultsSource files that were modified by the recipe run.org.openrewrite.table.SourcesFileResults
  • Source files that had search resultsSearch results that were found during the recipe run.org.openrewrite.table.SearchResults
  • Source files that errored on a recipeThe details of all errors produced by a recipe run.org.openrewrite.table.SourcesFileErrors
  • Recipe performanceStatistics used in analyzing the performance of recipes.org.openrewrite.table.RecipeRunStats