MultilineCommentLeadingAsteriskPresence

Since Checkstyle 13.9.0

Description

Checks if the multi-line comments have leading asterisks on each line.

Every line in multi-line comment should have leading asterisk including blank line.

Examples

To configure the check:


<module name="Checker">
  <module name="TreeWalker">
    <module name="MultilineCommentLeadingAsteriskPresence"/>
  </module>
</module>

Example:


public class Example1 {

  /*
   * Line has leading asterisk.
   */
  void foo() {}

  // violation 2 lines below """Multiline comment line(s) 25
  // should start with leading asterisk"""
  /* Line with leading asterisk
     Line with leading asterisk
  */
  void bar() {}

  /* Single line comment */
  void method() {}

}

Example of Usage

Violation Messages

All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.

Fully Qualified Name

com.puppycrawl.tools.checkstyle.checks.MultilineCommentLeadingAsteriskPresenceCheck

Use this fully qualified class name in configuration when an exact class reference is required.

Parent Module

TreeWalker