Find checkNotNull(x) without an explanatory message

Proprietary

checkNotNull(x) throws an IllegalStateException with a generic message. Pass a lazy message — checkNotNull(x) { "state invariant: x ready after init" } — to make the failure self-documenting.

org.openrewrite.kotlin.idiom.FindCheckNotNullWithoutMessage$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.idiom.FindCheckNotNullWithoutMessage$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.