Skip to content

Commit db5d8e0

Browse files
refactor: Refaster rules related to expressions dealing with Strings
Use this link to re-run the recipe: https://app.moderne.io/recipes/tech.picnic.errorprone.refasterrules.StringRulesRecipes?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne <[email protected]>
1 parent 04264fd commit db5d8e0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/org/openrewrite/java/spring/search/FindApiCalls.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import org.openrewrite.java.tree.J;
2929
import org.openrewrite.marker.SearchResult;
3030

31-
import java.util.Objects;
32-
3331
@Value
3432
@EqualsAndHashCode(callSuper = false)
3533
public class FindApiCalls extends Recipe {
@@ -60,7 +58,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
6058
String httpMethod = method.getSimpleName().substring(0, method.getSimpleName().indexOf("For")).toUpperCase();
6159
Expression uri = method.getArguments().get(0);
6260
String uriValue = uri instanceof J.Literal ?
63-
Objects.toString(((J.Literal) uri).getValue()) :
61+
String.valueOf(((J.Literal) uri).getValue()) :
6462
uri.printTrimmed(getCursor());
6563
m = SearchResult.found(m, httpMethod + " " + uriValue);
6664
calls.insertRow(ctx, new ApiCalls.Row(

0 commit comments

Comments
 (0)