introduce_parameter_object
Bundle a method's parameters into a new parameter-object class and rewrite the method and all callers to use it, simplifying signatures across your Java codebase.
Instructions
Bundle a method's parameters into a new parameter-object class and rewrite the method and all callers to use it. The class is generated as a member of the declaring type.
USAGE: Position on the method name; optionally name the class and parameter. OUTPUT: editsByFile with all required edits; warnings from JDT's condition checking, by the place each names (file, then position; those naming one place in JDT's order, those naming none last). Edits are returned as text - apply them yourself.
IMPORTANT: Uses ZERO-BASED coordinates.
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Zero-based line number of the method declaration | |
| column | Yes | Zero-based column number (on the method name) | |
| filePath | Yes | Path to source file containing the method | |
| className | No | Name for the parameter-object class (default: <MethodName>Parameters) | |
| parameterName | No | Name for the new parameter (default: parameterObject) |