@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    ASTNode loopStatement = getLoopParent(astNode);
    if (loopStatement == null) return;

    final Document doc = editor.getDocument();
    ASTNode body;
    if (BasicJavaAstTreeUtil.is(loopStatement, BASIC_FOR_STATEMENT)) {
      body = BasicJavaAstTreeUtil.getForBody(loopStatement);
    }
    else if (BasicJavaAstTreeUtil.is(loopStatement, BASIC_FOREACH_STATEMENT)) {
      body = BasicJavaAstTreeUtil.getForeachBody(loopStatement);
    }
    else if (BasicJavaAstTreeUtil.is(loopStatement, BASIC_WHILE_STATEMENT)) {
      body = BasicJavaAstTreeUtil.getWhileBody(loopStatement);
    }
    else {
      return;
    }

    if (BasicJavaAstTreeUtil.is(body, BASIC_BLOCK_STATEMENT)) return;
    if (body != null && startLine(doc, body) == startLine(doc, loopStatement)) return;

    fixLoopBody(editor, processor, loopStatement, doc, body);
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)