Skip to content

Commit

Permalink
Added PreferLongCompareUnsigned to NoGuava
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Jan 11, 2024
1 parent a198cd6 commit 1a41a7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

class PreferJavaStringJoinVisitor extends JavaIsoVisitor<ExecutionContext> {
private static final MethodMatcher ON_METHOD_MATCHER =
new MethodMatcher("com.google.common.base.Joiner on(String)");
new MethodMatcher("com.google.common.base.Joiner on(String)");

@Override
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
Expand Down Expand Up @@ -61,13 +61,12 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu

maybeRemoveImport("com.google.common.base.Joiner");

J.MethodInvocation x = JavaTemplate.apply(
return JavaTemplate.<J.MethodInvocation>apply(
"String.join(#{any(java.lang.CharSequence)}",
getCursor(),
mi.getCoordinates().replace(),
select.getArguments().get(0)
);
return x.withArguments(newArgs);
).withArguments(newArgs);
}
return mi;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/rewrite/no-guava.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ recipeList:
- org.openrewrite.java.migrate.guava.PreferIntegerCompareUnsigned
- org.openrewrite.java.migrate.guava.PreferIntegerDivideUnsigned
- org.openrewrite.java.migrate.guava.PreferIntegerParseUnsignedInt
- org.openrewrite.java.migrate.guava.PreferJavaStringJoinVisitor
- org.openrewrite.java.migrate.guava.PreferLongCompareUnsigned
- org.openrewrite.java.migrate.guava.PreferLongDivideUnsigned
- org.openrewrite.java.migrate.guava.PreferLongParseUnsignedLong
Expand Down

0 comments on commit 1a41a7f

Please sign in to comment.