Suppose we've written a method and we want to change the signature of it. Perhaps, we didn't originally envision what parameters we would need to pass into a method, or perhaps we're passing too many parameters and want to change the method signature to take a class that will represent all our parameters instead. The NetBeans Change Method Parameters… refactor helps us in these situations.
First we will need a Java project so that we can change the parameters of a method. We will use the same project from the earlier recipe, Rename refactoring, and so ensure that you have the project open from the end of that recipe. If you have not followed that recipe, the project is available from the code download bundle under the MoveRefactor
folder in Chapter 3
. When the Projects explorer shows the Refactoring
project, expand the Refactoring
node if not yet expanded.