• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to change interface method name with no rework?

 
jacob deiter
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49380
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changing a method name (including all its uses) is one of the standard refactorings offered by modern IDEs (like IntelliJ, Eclipse, and NetBeans).
 
fred rosenberger
lowercase baba
Bartender
Posts: 12143
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic