private static ExpressionEvaluator createExpressionEvaluator(Project project,
                                                               PsiElement contextPsiElement,
                                                               SourcePosition contextSourcePosition,
                                                               TextWithImports text,
                                                               Function<? super PsiElement, ? extends PsiCodeFragment> fragmentFactory)
    throws EvaluateException {
    try {
      return EvaluatorBuilderImpl.build(text, contextPsiElement, contextSourcePosition, project);
    }
    catch (UnsupportedExpressionException ex) {
      ExpressionEvaluator eval = CompilingEvaluatorImpl.create(project, contextPsiElement, fragmentFactory);
      if (eval != null) {
        return eval;
      }
      throw ex;
    }
    catch (IndexNotReadyException ex) {
      throw new EvaluateException(JavaDebuggerBundle.message("evaluation.error.during.indexing"), ex);
    }
  }
private static ExpressionEvaluator createExpressionEvaluator(Project project,
                                                               PsiElement contextPsiElement,
                                                               SourcePosition contextSourcePosition,
                                                               TextWithImports text,
                                                               Function<? super PsiElement, ? extends PsiCodeFragment> fragmentFactory)