private void invoke(final Project project, PsiMethod method, Editor editor) {
    if(method.isConstructor()){
      CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + JavaRareRefactoringsBundle.message("constructor.returns.can.not.be.wrapped"),
                                          getRefactoringNameText(), this.getHelpID());
      return;
    }
    final PsiType returnType = method.getReturnType();
    if(PsiTypes.voidType().equals(returnType)){
      CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + JavaRareRefactoringsBundle.message("method.selected.returns.void"),
                                          getRefactoringNameText(), this.getHelpID());
      return;
    }
    method = SuperMethodWarningUtil.checkSuperMethod(method);
    if (method == null) return;

    if(method instanceof PsiCompiledElement){
      CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + RefactorJBundle.message(
        "the.selected.method.cannot.be.wrapped.because.it.is.defined.in.a.non.project.class"), getRefactoringNameText(), this.getHelpID());
      return;
    }

    new WrapReturnValueDialog(method).show();


  }
private void invoke(final Project project, PsiMethod method, Editor editor)