Equals avoids null
MSALChecks that any combination of String literals is on the left side of an equals() comparison. Also checks for String literals assigned to some field (such as someString.equals(anotherString = "text")). It also removes redundant null checks in conjunction with equals() comparisons. Placing the literal on the left side prevents NullPointerExceptions, since a literal can never be null and its equals method handles null arguments safely.
org. openrewrite. staticanalysis. EqualsAvoidsNullmod run . --recipe= org. openrewrite. staticanalysis. EqualsAvoidsNullInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.