Add a @Nullable upper bound to a pass-through type parameter fed a null-returning lambda
ProprietaryWhen 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. AddNullableBoundToPassthroughTypeParametermod run . --recipe= io. moderne. nullability. AddNullableBoundToPassthroughTypeParameterInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.