private boolean prepare(@Nullable Consumer<? super ExtractMethodProcessor> pass, boolean showErrorHint) {
    setShowErrorDialogs(false);
    try {
      if (prepare(pass)) {
        return true;
      }

      final String message = RefactoringBundle.getCannotRefactorMessage(
        RefactoringBundle.message("is.not.supported.in.the.current.context", myRefactoringName));
      LOG.info(message);
      if (showErrorHint) {
        CommonRefactoringUtil.showErrorHint(myProject, null, message, myRefactoringName, HelpID.EXTRACT_METHOD);
      }
      return false;
    }
    catch (PrepareFailedException e) {
      LOG.info(e);
      if (showErrorHint) {
        CommonRefactoringUtil.showErrorHint(myProject, null, e.getMessage(), myRefactoringName, HelpID.EXTRACT_METHOD);
      }
      return false;
    }
  }
private boolean prepare(@Nullable Consumer<? super ExtractMethodProcessor> pass, boolean showErrorHint)