9

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)

rabbit
  • 103
  • 1
  • 4

2 Answers2

26
  1. Delete the method body
  2. Then select the method
  3. Refactor -> Inline
Vitalii Fedorenko
  • 110,878
  • 29
  • 149
  • 111
  • 9
    I 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