java_rename_method
Rename a Java method across your project by specifying the class and method names. Uses OpenRewrite to update all call sites automatically, with an optional dry run to preview changes.
Instructions
Rename a Java method and update all call sites using OpenRewrite
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectPath": "<projectPath>",
"className": "<className>",
"oldMethodName": "<oldMethodName>",
"newMethodName": "<newMethodName>"
},
"name": "java_rename_method"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview changes without applying (default: true) | |
| className | Yes | Fully qualified class name containing the method | |
| javaVersion | No | Java version to use (e.g., "17.0.16-amzn", "21.0.8-tem") | |
| projectPath | Yes | Path to the Java project root | |
| newMethodName | Yes | New method name | |
| oldMethodName | Yes | Current method name | |
| parameterTypes | No | Optional: parameter types to match specific overload |