Talk:Rename Method

From Wikipedia, the free encyclopedia

Can someone please elaborate on this topic?

What else would be needed here? Cgsguy2 18:01, 30 December 2006 (UTC)

[edit] Ways to make Rename Method Safer

"Java 5.0 provides the annotation @Override to protect against mistakes like this."

I think the relevance of @override is tenuous here... my guess is that the contributor intended that if you keep the whole method signature intact when you rename the function, the new function will have the @override and the compiler will warn that you are no longer overriding a superclass method. Now, that certainly works if you try renaming a method inherited from a superclass, but according to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5008260 will not work until Java 6.0 on a method implementation for an interface. Which makes it not so useful for now.

If we are talking useful annotations, then @deprecated might apply...

  • Copy Method
  • make the old method stub deprecated...
  • wait for years as the last laggards update their client code
  • come back, see the deprecated method, and say, gee, I can probably delete that by now

--Marcinjeske (talk) 20:41, 29 March 2008 (UTC)