Programming with Castalia : Refactoring : Rename Method
Previous  Top  Next

The name of a method does not adequately describe its purpose.

Change the name of the method to something more appropriate.

renamemethoduml

To rename a method, place the cursor within the method that you wish to rename. Invoke the Rename Method refactoring from the editor context menu or the Edit menu. The Rename Method dialog will appear:

renamemethod  
 
Type the method's new name in the New Name field and click OK. The Refactoring Explorer will appear.

renamemethodpane  
 
The Refactoring Explorer's proposed changes will include the declaration and the implementation of the method you are renaming, as well as any calls to the method within the same unit. You may review the proposed changes if you wish (double-click on a change to go to that location in code), deselecting any changes that you do not want to make. Click GO to make the selected changes in the code. Compile and test to ensure that the code functions as expected.

See also: Refactoring Overview, Extract Method Refactoring