Skip to content

Commit

Permalink
refactor: Common static analysis issues
Browse files Browse the repository at this point in the history
Use this link to re-run the recipe: https://app.moderne.io/recipes/builder/xXYPfpNDg?organizationId=T3BlblJld3JpdGU%3D

Co-authored-by: Moderne <team@moderne.io>
  • Loading branch information
2 people authored and app committed Mar 12, 2024
1 parent ee819d5 commit 86835c2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public J visitBinary(J.Binary binary, P p) {
if (left instanceof J.MethodInvocation && right instanceof J.MethodInvocation) {
J.MethodInvocation leftMethod = (J.MethodInvocation) left;
J.MethodInvocation rightMethod = (J.MethodInvocation) right;
boolean bothStartsWith = leftMethod.getSimpleName().equals("startswith") && rightMethod.getSimpleName().equals("startswith");
boolean bothEndsWith = leftMethod.getSimpleName().equals("endswith") && rightMethod.getSimpleName().equals("endswith");
boolean bothStartsWith = "startswith".equals(leftMethod.getSimpleName()) && "startswith".equals(rightMethod.getSimpleName());
boolean bothEndsWith = "endswith".equals(leftMethod.getSimpleName()) && "endswith".equals(rightMethod.getSimpleName());
if ((bothStartsWith || bothEndsWith) &&
leftMethod.getSelect() != null &&
rightMethod.getSelect() != null &&
Expand Down

0 comments on commit 86835c2

Please sign in to comment.