FindMethods cannot find arguments for subclasses #6089
-
|
I want to use # rewrite.yml
---
type: specs.openrewrite.org/v1beta/recipe
name: com.yourorg.FindMethodsExample
displayName: Find method usages example
recipeList:
- org.openrewrite.java.search.FindMethods:
methodPattern: com.example.Foo toString()
- org.openrewrite.java.search.FindMethods:
methodPattern: java.lang.String valueOf(com.example.Foo)The MethodMatcher argument check compares it with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
In the method matcher pattern you have to write the pattern in a way such that it matches the declaration signature: |
Beta Was this translation helpful? Give feedback.
In the method matcher pattern you have to write the pattern in a way such that it matches the declaration signature:
java.lang.String valueOf(java.lang.Object). If you also want it to match the other overloads of this method for the primitive types, you can usejava.lang.String valueOf(*)