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

    if (fixMethodCallWithoutTrailingSemicolon(astNode, editor, processor)) {
      return;
    }

    ASTNode returnValue = BasicJavaAstTreeUtil.getReturnValue(astNode);
    if (returnValue != null
        && lineNumber(editor, editor.getCaretModel().getOffset()) == lineNumber(editor, returnValue.getTextRange().getStartOffset())) {
      return;
    }

    ASTNode parent = BasicJavaAstTreeUtil.getParentOfType(astNode, ParentAwareTokenSet.create(BASIC_CLASS_INITIALIZER, BASIC_METHOD));
    if (BasicJavaAstTreeUtil.is(parent, BASIC_METHOD)) {
      ASTNode type = BasicJavaAstTreeUtil.findChildByType(parent, BASIC_TYPE);
      if (type != null && !type.getText().equals("void")) {
        final int startOffset = astNode.getTextRange().getStartOffset();
        if (returnValue != null) {
          editor.getDocument().insertString(startOffset + "return".length(), ";");
        }

        processor.registerUnresolvedError(startOffset + "return".length());
      }
    }
  }
@Override
  public void apply(Editor editor, AbstractBasicJavaSmartEnterProcessor processor, @NotNull ASTNode astNode)