@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode) throws IncorrectOperationException {
    if (BasicJavaAstTreeUtil.is(astNode, BASIC_CATCH_SECTION)) {
      final Document doc = editor.getDocument();

      final int catchStart = astNode.getTextRange().getStartOffset();
      int stopOffset = doc.getLineEndOffset(doc.getLineNumber(catchStart));

      final ASTNode catchBlock = BasicJavaAstTreeUtil.getCatchBlock(astNode);
      if (catchBlock != null) {
        stopOffset = Math.min(stopOffset, catchBlock.getTextRange().getStartOffset());
      }
      stopOffset = Math.min(stopOffset, astNode.getTextRange().getEndOffset());

      final ASTNode lParenth = BasicJavaAstTreeUtil.getLParenth(astNode);
      if (lParenth == null) {
        doc.replaceString(catchStart, stopOffset, "catch ()");
        processor.registerUnresolvedError(catchStart + "catch (".length());
      }
      else {
        if (BasicJavaAstTreeUtil.getParameter(astNode) == null) {
          processor.registerUnresolvedError(lParenth.getTextRange().getEndOffset());
        }
        if (BasicJavaAstTreeUtil.getRParenth(astNode) == null) {
          doc.insertString(stopOffset, ")");
        }
      }
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)