From 86835c2da4a3aa23a6e953aa46d2541d8c068c2b Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 12 Mar 2024 11:28:16 +0000 Subject: [PATCH] refactor: Common static analysis issues Use this link to re-run the recipe: https://app.moderne.io/recipes/builder/xXYPfpNDg?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- .../org/openrewrite/python/cleanup/StartsWithEndsWith.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openrewrite/python/cleanup/StartsWithEndsWith.java b/src/main/java/org/openrewrite/python/cleanup/StartsWithEndsWith.java index dda05cdd..626998c0 100644 --- a/src/main/java/org/openrewrite/python/cleanup/StartsWithEndsWith.java +++ b/src/main/java/org/openrewrite/python/cleanup/StartsWithEndsWith.java @@ -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 &&