• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tools To Rename Local Variables

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a long shot, but you never know !

Does anyone know of a tool (even better, Eclipse plugin) that allows local variables to be prefixed, ie change status to xStatus?

I ask because we're trying to use Checkstyle within Eclipse to enforce our coding standards, but we have some really big classes that means this chore can take a couple of hours to prefix all our local vars.

Dave
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It wouldn't be that difficult to write a plugin, but I don't know a ready-made.
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using Eclipse you can put your input cursor over the variable that you want to rename, right click and select "Refactor" from the context menu (or ALT+Shift+T) and select "Rename" from the Refactor menu.
 
Dave Hewy
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies.

I know Eclipse can do this on an individual basis, but I want to do it for a complete Java class, in one go.

Looks like a home-grown solution is the only option if noone knows of anything out there that can do this.
reply
    Bookmark Topic Watch Topic
  • New Topic