@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    if (BasicJavaAstTreeUtil.is(astNode, BASIC_DO_WHILE_STATEMENT)) {
      final Document doc = editor.getDocument();
      ASTNode whileKeyword = BasicJavaAstTreeUtil.getWhileKeyword(astNode);
      ASTNode doWhileBody = BasicJavaAstTreeUtil.getDoWhileBody(astNode);
      if (doWhileBody == null || !(BasicJavaAstTreeUtil.is(doWhileBody, BASIC_BLOCK_STATEMENT)) && whileKeyword == null) {
        final int startOffset = astNode.getTextRange().getStartOffset();
        doc.replaceString(startOffset, startOffset + "do".length(), "do {} while()");
        return;
      }

      if (BasicJavaAstTreeUtil.getWhileCondition(astNode) == null) {
        if (whileKeyword == null) {
          final int endOffset = astNode.getTextRange().getEndOffset();
          doc.insertString(endOffset, "while()");
        }
        else if (BasicJavaAstTreeUtil.getLParenth(astNode) == null || BasicJavaAstTreeUtil.getRParenth(astNode) == null) {
          final TextRange whileRange = whileKeyword.getTextRange();
          doc.replaceString(whileRange.getStartOffset(), whileRange.getEndOffset(), "while()");
        }
        else {
          ASTNode lParenth = BasicJavaAstTreeUtil.getLParenth(astNode);
          if (lParenth != null) {
            processor.registerUnresolvedError(lParenth.getTextRange().getEndOffset());
          }
        }
      }
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)