Add a @Nullable upper bound to a pass-through type parameter fed a null-returning lambda

Proprietary

When a null-returning lambda is passed to a generic method whose single, unbounded type parameter is also its return type (a value pass-through such as <T> T record(String, Supplier<T>)), widen the declaration to <T extends @Nullable Object> so returning null through it is legal under JSpecify/NullAway. Relaxing the upper bound is sound; it never rejects previously-valid code. Only methods declared in the working set, with exactly one unbounded type parameter that is the return type, are changed.

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

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.