[Refactoring-UI] Push down should clearly state that we can lose a method
When doing push down on a method that exists in the subclass, the method in the superclass is simply removed without explicitly stating that this is something abnormal. This behavior is quite unexpected and it should show a warning similar to situations like when renaming to a selector that already exists and similar.
Steps to reproduce:
- Create a method with code
abc ^ 1in any class that has a subclass - Create a method with code
abc ^ 2in its direct subclass - Right click the 'abc' method in the superclass (the one that returns 1)
- Refactorings
- Push down
- Refactor
- Notice how it only offers to remove the method in the superclass without creating or changing anything else
- Ok
The method from the superclass was removed without anything warning that the push down does not actually happen because the method exists in one of the subclasses. Removing the method might be one of the possible resolutions of the conflict, but the user should be informed about the conflict and ideally should be able to choose what to do (replace the one in the subclass, remove the one from superclass, do nothing?)
Thanks for this bug report.
We should not lose method so this is a bug.