File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to change interface method name with no rework? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to change interface method name with no rework?" Watch "How to change interface method name with no rework?" New topic
Author

How to change interface method name with no rework?

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
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: 36508
    
  16
You can't.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Changing a method name (including all its uses) is one of the standard refactorings offered by modern IDEs (like IntelliJ, Eclipse, and NetBeans).


Ping & DNS - updated with new look and Ping home screen widget
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10916
    
  12

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to change interface method name with no rework?
 
Similar Threads
In terms of rework what to choose an interface or abstract class ????
Invalid Magic Cookie
About:My URLyBird1.3.2 Locking
search results filtering
Deep Copies?