• 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

Eclipse setup question

 
Ranch Hand
Posts: 193
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you configure Eclipse so that whenever a new class is created the editor will open with a customized commented prolog section?

like:

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Edit the file header template.

Java -> Code Style -> Templates -> Comments - Files.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a weird way to comment Java classes, though, and completely bypasses the built-in Javadoc mechanism.

IMO including change history in the file itself is a code smell: that's what SCCSs are for.
 
Higgledy Smith
Ranch Hand
Posts: 193
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:That's a weird way to comment Java classes, though, and completely bypasses the built-in Javadoc mechanism.

IMO including change history in the file itself is a code smell: that's what SCCSs are for.



I agree. The company I worked for at the time insisted on it, not me.
 
Saloon Keeper
Posts: 27762
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

David Newton wrote:That's a weird way to comment Java classes, though, and completely bypasses the built-in Javadoc mechanism.

IMO including change history in the file itself is a code smell: that's what SCCSs are for.



Actually, this particular prototype is rather odd. If the SCCS is CVS, the $Log$ keyword will be expanded to list the changes. There doesn't seem to be a point to having someone add manual history below that, as the example seems to imply.

CVS is a little odd itself. It actually does expand the log into the source file archive itself, then appends later log messages as updates are made. Or such has been my experience.

SVN took a different tack, which I'm not sure I agree with. On the one hand, when you have 3 pages of log history before you even see the code, it can be a real nuisance. But the history does provide a cue as to where people have been meddling, when bugs pop up.

Then again, I have a bigger problem when people create source lines that are 3x wider than the printed page. For serious debugging I've never successfully made it to "paperless" (and some of these guys also bleed off the screen as well). Trying to highlight items with my infamous pink marker on an LCD screen just doesn't seem to work.
 
reply
    Bookmark Topic Watch Topic
  • New Topic