Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.24 KB

JavadocMissingLeadingAsterisk.md

File metadata and controls

55 lines (40 loc) · 1.24 KB

Pattern: Missing leading * in Javadoc

Issue: -

Description

Checks if the javadoc has leading asterisks on each line.

The check does not require asterisks on the first line, nor on the last line if it is blank. All other lines in a Javadoc should start with *, including blank lines and code blocks.

Examples

/**
 * Valid Java-style comment.
 *
 * <pre>
 *   int value = 0;
 * </pre>
 */
class JavaStyle {} // ok

/** Valid Scala-style comment.
  * Some description here.
  **/
class ScalaStyle {} // ok

/** **
  * Asterisks on first and last lines are optional.
  * */
class Asterisks {} // ok

/** No asterisks are required for single-line comments. */
class SingleLine {} // ok

/** // violation on next blank line, javadoc has lines without leading asterisk.

 */
class BlankLine {}

/** Wrapped
    single-line comment */ // violation, javadoc has lines without leading asterisk.
class Wrapped {}

/**
  * <pre>
    int value; // violation, javadoc has lines without leading asterisk.
  * </pre>
  */
class Code {}

Further Reading