Use method references in lambda
MSALReplaces the single statement lambdas o -> o instanceof X, o -> (A) o, o -> System.out.println(o), o -> o != null, o -> o == null with the equivalent method reference. Method references are often more concise and readable than their lambda equivalents, making the code's intent clearer at a glance.
org. openrewrite. staticanalysis. ReplaceLambdaWithMethodReferencemod run . --recipe= org. openrewrite. staticanalysis. ReplaceLambdaWithMethodReferenceInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.