Find x ?: throw SomeException() without a message

Proprietary

x ?: throw IllegalStateException() (no message arg) throws with a stack trace and no context. Pass an argument that explains why x was expected non-null at this point — error reports are the cheapest tool we have.

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