Suppose I have a class like this.
Public class MyClass{
private String id;
public Myclass(String id){
this.id = id;
}
public String getId(){
return id;
}
public void setId(String id){
this.id = id;
}
}
And suddenly I want to change the type of id
into Integer
. Is there a way to do that with intellij without breaking usages?
Try to set cursor on variable and use shortcut Shift-F6 - after that there are dialog frame for change name of variable and it changes all occurences of variable to setted name.
Invoke refactoring Select an item to refactor. You can select a file/folder in the Project tool window or expression/symbol in the editor. Press Ctrl+Alt+Shift+T to open a list of refactorings that can be selected. Alternatively, you can use a keyboard shortcut for a specific refactoring.
Add environment variables From the main menu, select Run | Edit Configurations or choose Edit Configurations from the run/debug configurations selector on the toolbar. In the Run/Debug Configurations dialog, select a configuration you want to add the environment variables to.
Highlight the type of field and press Ctrl+Shift+F6
or
Highlight the type of field, Right-Click -> Refactor -> Type migration
or
Highlight the type of field, Menu -> Refactor -> Type migration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With