@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    if (!(BasicJavaAstTreeUtil.is(astNode, BASIC_FOR_STATEMENT))) {
      return;
    }

    final ASTNode lParenth = BasicJavaAstTreeUtil.getLParenth(astNode);
    final ASTNode rParenth = BasicJavaAstTreeUtil.getRParenth(astNode);
    if (lParenth == null || rParenth == null) {
      final TextRange textRange = astNode.getTextRange();
      editor.getDocument().replaceString(textRange.getStartOffset(), textRange.getEndOffset(), "for () {\n}");
      processor.registerUnresolvedError(textRange.getStartOffset() + "for (".length());
      return;
    }

    final ASTNode initialization = BasicJavaAstTreeUtil.getForInitialization(astNode);
    if (initialization == null) {
      processor.registerUnresolvedError(lParenth.getTextRange().getEndOffset());
      return;
    }

    final ASTNode condition = BasicJavaAstTreeUtil.getForCondition(astNode);
    if (condition == null) {
      boolean endlessLoop = BasicJavaAstTreeUtil.is(initialization, BASIC_EMPTY_STATEMENT) &&
                            BasicJavaAstTreeUtil.getForUpdate(astNode) == null;
      if (!endlessLoop) {
        registerErrorOffset(editor, processor, initialization, astNode);
      }
      return;
    }

    if (BasicJavaAstTreeUtil.getForUpdate(astNode) == null) {
      registerErrorOffset(editor, processor, condition, astNode);
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)