Reputation: 79
I had my clearScreen method in my Settings class and moved it into my Formats class. Since ive used it many times already i dont really want to change it every time. When I try to rename it using refactoring though, it gives me these errors: "Compilation untit Formats.java already exists" and "Type named Formats already exists in Package(default package)"
Is there any way to refactor the class thats being called?
If it isnt clear what i mean, it would go from
Settings.clearScreen();
to
Formats.clearScreen();
Upvotes: 1
Views: 63
Reputation: 140534
The easiest way is to:
Change the existing method to call the new method:
class Settings {
// ...
void clearScreen () {
Formats.clearScreen();
}
// ...
}
Select clearScreen
in Settings
and inline it.
Upvotes: 1