Replace Optional#isPresent() with Optional#ifPresent()
MSALReplace Optional#isPresent() with Optional#ifPresent(). This recipe only applies to if statements without an else branch and with a single condition.
org. openrewrite. staticanalysis. ReplaceOptionalIsPresentWithIfPresentmod run . --recipe= org. openrewrite. staticanalysis. ReplaceOptionalIsPresentWithIfPresentInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.