Issue
I'm currently using NetBeans and want to rename all occurrence of a instance variable inside a method so that it will become a distinct local variable in its own right. I know how to refactor a variable using refactor -> rename, but I don't know how to limit the scope of change to a method.
Solution
You can declare a local variable at the start of the method, then use the rename refactoring on it. Once done you can remove the local variable.
Answered By - JnRouvignac
Answer Checked By - Marilyn (JavaFixing Volunteer)