Skip to content

Commit

Permalink
Fix IndexOutOfBoundsException in EqualsAvoidsNull recipe (#394)
Browse files Browse the repository at this point in the history
fix #393
  • Loading branch information
ggerbaud authored Nov 25, 2024
1 parent 732da99 commit 8606477
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 8606477

Please sign in to comment.