This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Comment block format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Comment block format" Watch "Comment block format" New topic

Comment block format

Mikpo Siru
Ranch Hand

Joined: Apr 09, 2009
Posts: 54

When I hit Source->Format in NetBeans, in turns this:

into this:

Suggestions on a style that doesn't get re-formatted by NetBeans?

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

I have no idea what formatting NB or other IDEs might apply to a given comment form, especially a non-standard one like that, but I'd go with:

But in general you shouldn't need those section markers.

Note that comments that start with /** are interpreted by the javadoc tool, so probably NB is reformatting to fit the more standard

format, where the javadoc marker /** is immediately followed by a newline.

Peter Johnson

Joined: May 14, 2008
Posts: 5852

When I want block comment like that I use single-line comments:

I don't think the IDE reformats single-line comment.

JBoss In Action
Mikpo Siru
Ranch Hand

Joined: Apr 09, 2009
Posts: 54
Thank you both
I agree. Here's the link:
subject: Comment block format
It's not a secret anymore!