Use Map#isEmpty() instead of comparing size()
MSALReplaces comparisons of Map#size() to zero with isEmpty(), or with !isEmpty() when testing for a non-zero size. Using isEmpty() communicates intent more clearly than comparing size() to zero, and for some map implementations isEmpty() can be more efficient since size() may require traversal.
org. openrewrite. staticanalysis. IsEmptyCallOnMapsmod run . --recipe= org. openrewrite. staticanalysis. IsEmptyCallOnMapsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.