Skip to content

Replace class1.method1 with class2.method2 using open rewrite #3712

Closed Answered by timtebeek
Lipuxy asked this question in Q&A
Discussion options

You must be logged in to vote

You can combine existing building block recipes through our recipe builder

type: specs.openrewrite.org/v1beta/recipe
name: com.github.timtebeek
displayName: Rename class and method
description: Example
recipeList:
  - org.openrewrite.java.ChangeType:
      oldFullyQualifiedTypeName: foo.Class1
      newFullyQualifiedTypeName: bar.Class2
  - org.openrewrite.java.ChangeMethodName:
      methodPattern: bar.Class2 foo()
      newMethodName: bar.Class2 bar()

There's more documentation available here: https://docs.openrewrite.org/authoring-recipes/types-of-recipes

Hope that helps!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by timtebeek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants