Class CommentsIndentationCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class CommentsIndentationCheck
    extends AbstractCheck
    This Check controls the indentation between comments and surrounding code. Comments are indented at the same level as the surrounding code. Detailed info about such convention can be found here

    Examples:

    To configure the Check:

     
     <module name="CommentsIndentation"/>
     
     
     /*
      * comment
      * some comment
      */
     boolean bool = true; - such comment indentation is ok
        /*
        * comment
        * some comment
         */
     double d = 3.14; - Block Comment has incorrect indentation level 7, expected 4.
     // some comment - comment is ok
     String str = "";
         // some comment Comment has incorrect indentation level 8, expected 4.
     String str1 = "";
     
     
    Author:
    Aleksey Nesterenko, Andrei Selkin