Renaming a method
You can rename a method by modifying its declaration
in the compilation unit in which it is declared. However, if you also want
to update all references to it, you must either:
- In a Java view presenting methods (for example the Outline view) select
the method to be renamed.
- From the view's pop-up menu, select Refactor > Rename or
select Refactor > Rename from the global menu bar.
or
- In a Java editor, select a reference to or the declaration of the method
to be renamed.
- From the editor's pop-up menu, select Refactor > Rename or
select Refactor > Rename from the global menu bar.
Note 1: Renaming a method declared in an
interface also renames (and updates all references to) all methods that
are implementations of that method
Note 2: When renaming a non-static method
declared as public, package visible, or protected, all methods overriding
it are also renamed and all references to them are updated.
Note 3: Renaming a static method or a private
method updates references only to that method.
Java development tools (JDT)
Extracting a method
Overriding a method
Renaming method parameters
Override methods
Refactoring actions
Refactoring wizard
Refactoring preferences