Use var for variables initialized with type casts

MSAL

Apply local variable type inference var to variables that are initialized by a cast expression where the cast type matches the declared variable type. This removes the redundant type duplication. For example, String s = (String) obj; becomes var s = (String) obj;.

org.openrewrite.java.migrate.lang.var.UseVarForTypeCast
mod run . --recipe=org.openrewrite.java.migrate.lang.var.UseVarForTypeCast

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