Make a nullable Boolean condition null-safe with Boolean.TRUE.equals(...)
ProprietaryRewrites a provably-nullable boxed Boolean used as a condition that auto-unboxes to boolean — the control expression of an if, while, or do/while, the condition of a for, or the condition of a ternary ?: — to Boolean.TRUE.equals(cond). Inside an annotated scope NullAway flags such an unboxing because it throws NullPointerException when the Boolean is null; the Boolean.TRUE.equals(...) form yields false on null instead. This is a behavior change on the null path (a thrown NullPointerException becomes false), so each rewritten condition is stamped with a behavior-change marker recording exactly that. The fix fires only when the condition's static type is the boxed java.lang.Boolean (a primitive boolean is never touched) and it is provably nullable at the site; nullability comes from type attribution and a path-sensitive flow analysis (a value already null-checked on the path is not rewritten). A condition already wrapped in Boolean.TRUE.equals(...) or requireNonNull(...) is left unchanged (idempotent). The recipe is conservative — a value not proven nullable is never rewritten; only Java sources are modified.
io. moderne. nullability. SafeNullableBooleanConditionOptional
Comma-separated package prefixes to limit the fix to (matching NullAway's AnnotatedPackages option). When unset, the recipe fixes all packages.
mod run . --recipe= io. moderne. nullability. SafeNullableBooleanConditionInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.