Thor
Thor

Reputation: 10058

How to refactor a variable name in limited scope in Netbeans?

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.

Upvotes: 0

Views: 379

Answers (1)

JnRouvignac
JnRouvignac

Reputation: 787

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.

Upvotes: 1

Related Questions