Find Optional.ofNullable(...) calls

Proprietary

Optional.ofNullable(x) is the conversion T? -> Optional<T> — the very wrapping Kotlin's null type system was designed to make unnecessary. Inside Kotlin code, return x and let ?:/?.let { … } express the absent-value branch directly.

org.openrewrite.kotlin.interop.FindOptionalOfNullable$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.interop.FindOptionalOfNullable$KtRecipe'

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