java_change_method_signature
Change a Java method or record constructor signature by adding, removing, or reordering parameters in one refactoring. Automatically updates record declarations and call sites.
Instructions
Change a Java method or record constructor signature with multiple parameter operations (add, remove, reorder) in a single refactoring. More efficient than calling individual tools when making multiple changes. For Java records, use methodName "" or the class name - the tool auto-detects records and updates both the record declaration AND all "new RecordName(...)" call sites (adding null for new parameters).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview changes without applying (default: true) | |
| className | Yes | Fully qualified class name containing the method or record | |
| methodName | Yes | Method name. For record constructors, use "<init>" or the class name (e.g., "MyRecord") | |
| javaVersion | No | Java version to use (e.g., "17.0.16-amzn", "21.0.8-tem") | |
| projectPath | Yes | Path to the Java project root | |
| parametersToAdd | No | Parameters to add to the method | |
| newParameterOrder | No | Final parameter order by name. Applied after additions and removals. | |
| existingParameterTypes | No | Existing parameter types to match specific overload | |
| parameterIndicesToRemove | No | Indices of parameters to remove (0-indexed, from original signature). Processed before additions. |