• Home
  • About

Eclipse Tips

Feeds:
Posts
Comments

When your code has an identity crisis

November 21, 2007 by David

Did you know that Sting used to be named Gordon Sumner, that John Denver was Henry John Deutschendorf or that Michael J. Fox was Michael A. Fox? Name changes are uncommon when we’re talking about people (except in the entertainment industry, apparently) but they’re very common when we’re talking about code.

Renaming is one of the most common refactorings I use, probably because naming things is hard but also possibly because I am fickle. In any case Eclipse provides a handy refactoring shortcut for renaming things. Try highlighting a symbol in an editor, say a class name, and hit Alt-Shift-R. You’ll be prompted to type a new name and then hit Enter at which point Eclipse will show you a preview of all the changes it’s going to make – any of which you can accept or reject. The same shortcut can be used on files and packages in the Package Exporer view.

Today’s tip:

Alt-Shift-R: rename refactoring

Posted in refactoring | Tagged a rose by any other name would smell as sweet | No Comments Yet

  • Archives

    • June 2008
    • December 2007
    • November 2007
  • Category Cloud

    debug editor help navigation other plugins refactoring run search

Blog at WordPress.com.

Theme: Mistylook by Sadish.