Take Care
Although it seems to be very easy to change a method name, code can be broken if refactoring tools (built into many modern IDE's) are not used to also change all code that refers to the existing method.
If a codebase has provided an external API that including the existing method name then the existing function should not be removed, but 'deprecated' over time and finally removed at a future date. In this case the "Copy Method" refactoring can be considered as an alternative.
- Java 5.0 provides the annotation @Override to help protect against mistakes such as this.
Read more about this topic: Rename Method
Famous quotes containing the word care:
“Pray my dear, quoth my mother, have you not forgot to wind up the clock?MGood G! cried my father, making an exclamation, but taking care to moderate his voice at the same time,Did ever woman, since the creation of the world, interrupt a man with such a silly question?”
—Laurence Sterne (17131768)
“It is said, the devil takes care of his own. Much more should a good spiritthe spirit of the Constitution and the Uniontake care of its own. I think it can not do less, and live.”
—Abraham Lincoln (18091865)