java - Is there a way to change method parameter list intellij? -
to generalized, let's take example this.
i have method this.
public void mymethod(int param1, string param2){ //do }
and want change this.
public void mymethod(int param1, string param2, string param3){ //do }
is there preferred way intellij without breaking usages?
you can followings intellij.
with refactor
-> change signature
menu, can:
- change method name, return type , visibility scope.
- add new parameters , remove existing ones. note can add parameter using dedicated extract parameter refactoring.
- reorder parameters.
- change parameter names , types.
- add , remove exceptions.
- propagate new parameters , exceptions through method call hierarchy.
to go refactor
-> change signature
menu
in editor, place cursor within name of method signature want change. 1 of following:
- press ctrl+f6.
- choose refactor | change signature in main menu.
- select refactor | change signature context menu (right-click).
for more, please have @ here
Comments
Post a Comment