Search code examples
javaspring-bootintellij-idea

Java IntelliJ: Change existing class usages to a new class


In Java Spring Boot using IntelliJ, how do I refactor existing class usages to a different class? I don't want to rename an existing class, but migrate to a new class. For example, change Fruit to Automobile class,

This reference does not help, https://www.jetbrains.com/help/idea/rename-refactorings.html#rename_class_example


Solution

  • You can try to use "Type migration" refactoring, see this