Use var for constructor call assignments

MSAL

Replace explicit type declarations with var when the variable is initialized with a constructor call of exactly the same type. Does not transform when declared type differs from constructor type (e.g., interface vs implementation).

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

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