I have a method which I want to delete. This method is being called from n number of classes. I want to delete this method using refactoring and also make eclipse delete all calls to this method rather than go and clean up in each file. I could not find a straight way to do this from refactor (I am using ganymede)
Asked
Active
Viewed 5,062 times
2 Answers
26
- Delete the method body
- Then select the method
Refactor -> Inline

Vitalii Fedorenko
- 110,878
- 29
- 149
- 111
-
9I love it! However, that does not work when the method is specified in an interface and the callers refer to the interface. Eclipse says "Cannot inline abstract methods", and when doing the inlining on method implementations, there are no changes after the refactor. – Nicolas Apr 01 '11 at 20:00
0
I don't think it can be done through refactoring. You can do a Search and replace using regex though.
CTRL-H to bring up the search replace dialog

Will
- 6,179
- 4
- 31
- 49
-
2Disappointing. I would like to delete this method, and automatically clean up any dead code it left behind. – Michael Munsey Feb 03 '11 at 00:43