Renaming method parameters
You can rename the parameters of a method by renaming the parameter's declaration as well as all references to the parameters inside the method body.
Use the Modify Parameters command to rename one or more parameters of a method as well as all references to these parameters.
-
Select the method in a Java view (the Outline view, for example)
-
From the method's pop-up menu, select Refactor > Modify Parameters or, from the menu bar, select
Refactor > Modify Parameters.
Note: these menu entries will no be active if the method has no parameters.
-
Select a parameter, press the Edit button, enter a new name for the parameter and press OK
To rename a single parameter, it is often easier to:
-
Select the parameter in the Java editor.
-
From the editor's pop-up menu, select Refactor > Rename to open the Rename refactoring wizard.
Java development tools (JDT)
Reordering method parameters
Refactoring actions
Refactoring wizard
Refactoring preferences