How to change interface method name with no rework?
jacob deiter
Ranch Hand
Joined: Apr 02, 2008
Posts: 576
posted
0
I have an interface with a method name “sampleMethodName()”,just forget about the syntax and all. This interface is implemented by many classes. If I want to chage the method name from “sampleMethodName()” to “NewSampleMethodName()”,then all the class implement this interface should be changed. But my intention is less rework. anyone can suggest how to do this ?
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32623
4
posted
0
You can't.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35229
7
posted
0
Changing a method name (including all its uses) is one of the standard refactorings offered by modern IDEs (like IntelliJ, Eclipse, and NetBeans).
if you're not using an IDE, you can also write a script that parses a file and does a substitution. You can do it in perl pretty easily, but i'm sure someone is going to post about the evils of perl soon, so use whatever scripting language you prefer.
Never ascribe to malice that which can be adequately explained by stupidity.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: How to change interface method name with no rework?