diff --git a/src/main/java/org/openrewrite/staticanalysis/EqualsAvoidsNullVisitor.java b/src/main/java/org/openrewrite/staticanalysis/EqualsAvoidsNullVisitor.java index 8ddc19a33..14864c924 100644 --- a/src/main/java/org/openrewrite/staticanalysis/EqualsAvoidsNullVisitor.java +++ b/src/main/java/org/openrewrite/staticanalysis/EqualsAvoidsNullVisitor.java @@ -59,6 +59,7 @@ public J visitMethodInvocation(J.MethodInvocation method, P p) { J.MethodInvocation m = (J.MethodInvocation) super.visitMethodInvocation(method, p); if (m.getSelect() != null && !(m.getSelect() instanceof J.Literal) && + !m.getArguments().isEmpty() && m.getArguments().get(0) instanceof J.Literal && isStringComparisonMethod(m)) { return literalsFirstInComparisonsBinaryCheck(m, getCursor().getParentTreeCursor().getValue());