1 package com.puppycrawl.tools.checkstyle.checks.indentation; 20 21 import com.puppycrawl.tools.checkstyle.api.DetailAST; 22 import com.puppycrawl.tools.checkstyle.api.TokenTypes; 23 24 29 public class WhileHandler extends BlockParentHandler 30 { 31 39 public WhileHandler(IndentationCheck aIndentCheck, 40 DetailAST aAst, ExpressionHandler aParent) 41 { 42 super(aIndentCheck, "while", aAst, aParent); 43 } 44 45 48 private void checkCondExpr() 49 { 50 final DetailAST condAst = getMainAst().findFirstToken(TokenTypes.EXPR); 51 final IndentLevel expected = 52 new IndentLevel(getLevel(), getBasicOffset()); 53 checkExpressionSubtree(condAst, expected, false, false); 54 } 55 56 59 public void checkIndentation() 60 { 61 checkCondExpr(); 62 super.checkIndentation(); 63 } 64 } 65 | Popular Tags |