java_add_parameter
Add a new parameter to a Java method or record constructor and automatically update all call sites, including record declarations. Supports overload matching and dry-run preview.
Instructions
Add a new parameter to a Java method or record constructor and update all call sites. For Java records, use methodName "" or the class name to target the constructor - the tool auto-detects records and updates both the record declaration AND all "new RecordName(...)" call sites (adding null as the new argument value).
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 | |
| parameterName | Yes | Name of the new parameter | |
| parameterType | Yes | Type of the new parameter | |
| parameterIndex | No | Position to insert parameter (0-indexed) | |
| existingParameterTypes | No | Existing parameter types to match specific overload |