Apps and Freedom

By Terry Pearson

Changing the default @author in Eclipse (IBM RAD) comments

without comments

Eclipse IDESomething that has annoyed me in the past is when I generate a new class, Eclipse puts the @author tag in the comments with my machine username. It ends up looking like this:


/*
* @author ID123

*/

Which is really not that helpful in some contexts. In the systems I work on, its just not simple to find out who that is. Since these are comments and not database entries, I’d rather see the name of the author.

The easiest way to fix this is to modify the default @author in Eclipse settings. To do so, do the following:

  1. Window ->Preferences
  2. Expand Java-> Code Style
  3. Click Code Templates
  4. On the right, expand Comments and click on Types
  5. Click the Edit button on the right and change ${user} to your name (or you can even enter your name after the user variable if the user ID is valuable to you).

Now you can have this in your code instead:

/*
* @author ID123 - Terry Pearson

*/

Thank you Aaron Saray for the tip!

Written by Terry Pearson

May 15th, 2012 at 12:05 pm

Posted in Java,Programming

Tagged with , ,

Leave a Reply


Creative Commons License
Terry Pearson - The Blog by Terry Pearson
is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.