Code refactoring can be a real pain. As your project grows, adding a parameter to a method or renaming it can turn into a nightmare. Eclipse has some refactoring tools that make such tasks a walk in the park.
Renaming variables manually can be tedious and time consuming. You could resort to find/replace to make it a little less painful. But since the variable name might be matched in other places of the code, you have to go through each match of the variable name and verify if it has to be modified (try renaming a variable named x
in a big enough class and you'll understand). If the variable is public, you would also have to scan the whole project for references of this variable.
Luckily, Eclipse does this for you. Just right-click on any occurrence of the variable in the code and navigate to Refactor | Rename. Type the new variable's name and hit Enter.
You can see that even if the name's variable occurs in other parts of the code, only the text that's within...