Replace unused variables with underscore

MSAL

Replace unused variable declarations with underscore (_) for Java 22+. This includes unused variables in enhanced for loops, catch blocks, and lambda parameters where the variable is never referenced.

org.openrewrite.java.migrate.lang.ReplaceUnusedVariablesWithUnderscore
mod run . --recipe=org.openrewrite.java.migrate.lang.ReplaceUnusedVariablesWithUnderscore

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