Cancel Formatting in Eclipse Java Comment

If you shift-ctrl-f or have a save function set to reformat your code in Eclipse, you stop it from formatting a java comment by using a “-” at the top:

/*-
 * Ignore Formatted Code Block 
 *
 *    myMethod()
 *
 *    Main Point
 *        sub point
 *
 *    @method
 *    @paramater
 *    @exception
 */

If you don’t do this you may end up with something undesirable like:

/**
 * Ignore Formatted Code Block 
 *
 *    myMethod()
 *
 *    Main Pointsub point
 *
 *    @method@paramater@exception
 */

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>