Skip to content

Commit 93a6d77

Browse files
refactor: Enum values should be compared with "=="
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.staticanalysis.CompareEnumsWithEqualityOperator?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne <team@moderne.io>
1 parent 7599254 commit 93a6d77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/openrewrite/java/logging/log4j/PrependRandomName.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public J.Literal visitLiteral(J.Literal literal, ExecutionContext ctx) {
5757
//noinspection ConstantConditions
5858
if (parent instanceof J.MethodInvocation &&
5959
logStatement.matches((J.MethodInvocation) parent) &&
60-
JavaType.Primitive.String.equals(literal.getType()) &&
60+
JavaType.Primitive.String == literal.getType() &&
6161
!literal.getValue().toString().startsWith("<")) {
6262
String value = "<" + randomName.next() + "> " + literal.getValue().toString();
6363
return literal.withValue(value)

0 commit comments

Comments
 (0)