Tony ([info]quikchange) wrote,
@ 2007-10-23 22:34:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current mood: jubilant
Current music:Midnight Coward - Stars
Entry tags:geeky

The hidden dangers of renaming methods
I spent half my day tracking this down so I am going to share it here.

When renaming a member function of a class, it is vital that you examine all classes that inherit from it to ensure that, should any of them override this function, you rename it there as well. Failure to do so can result in all sorts of nastiness.



(Post a new comment)

Good point
[info]kinthelt
2007-10-24 09:35 pm UTC (link)
I hate to be a zealot, but...

Doesn't Eclipse do that automatically when you refactor?

(Reply to this)(Thread)

Re: Good point
[info]thewizard
2007-10-24 09:37 pm UTC (link)
For Java it works very well. For C++ ... err, good luck! (In my experience)

(Reply to this)(Parent)

Re: Good point
[info]stak
2007-10-25 12:36 am UTC (link)
And even if you're not using Eclipse, Java 1.5 has handy @Override annotations that you can use so the compiler can spot these for you.

(Reply to this)(Parent)(Thread)

Re: Good point
[info]kinthelt
2007-10-25 11:35 am UTC (link)
That's a wonderful thing to know. I think I now know what I'll be doing at work today. :)

(Reply to this)(Parent)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…