Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 88d817f

Browse files
refactor: Equals avoids null
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.staticanalysis.EqualsAvoidsNull?organizationId=ODQ2MGExMTUtNDg0My00N2EwLTgzMGMtNGE1NGExMTBmZDkw Co-authored-by: Moderne <team@moderne.io>
1 parent 085f31f commit 88d817f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rewrite-python/src/main/java/org/openrewrite/python/internal/PythonPrinter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ public J visitBlock(J.Block block, PrintOutputCapture<P> p) {
916916
public J visitCase(J.Case ca, PrintOutputCapture<P> p) {
917917
beforeSyntax(ca, Location.CASE_PREFIX, p);
918918
J elem = ca.getCaseLabels().get(0);
919-
if (!(elem instanceof J.Identifier) || !((J.Identifier) elem).getSimpleName().equals("default")) {
919+
if (!(elem instanceof J.Identifier) || !"default".equals(((J.Identifier) elem).getSimpleName())) {
920920
p.append("case");
921921
}
922922
visitContainer("", ca.getPadding().getCaseLabels(), JContainer.Location.CASE_EXPRESSION, ",", "", p);

0 commit comments

Comments
 (0)