public boolean evaluateCondition(final EvaluationContextImpl context, LocatableEvent event) throws EvaluateException {
    DebugProcessImpl debugProcess = context.getDebugProcess();
    if (isCountFilterEnabled() && !isConditionEnabled()) {
      context.getSuspendContext().getVirtualMachine().suspend();
      debugProcess.getRequestsManager().deleteRequest(this);
      createRequest(debugProcess);
      context.getSuspendContext().getVirtualMachine().resume();
    }

    StackFrameProxyImpl frame = context.getFrameProxy();
    if (getProperties().isCALLER_FILTERS_ENABLED() && frame != null) {
      ThreadReferenceProxyImpl threadProxy = frame.threadProxy();
      StackFrameProxyImpl parentFrame = threadProxy.frameCount() > 1 ? threadProxy.frame(1) : null;
      String key = parentFrame != null ? DebuggerUtilsEx.methodKey(parentFrame.location().method()) : null;
      if (!typeMatchesClassFilters(key, getProperties().getCallerFilters(), getProperties().getCallerExclusionFilters())) {
        return false;
      }
    }

    if (isInstanceFiltersEnabled()) {
      Value value = context.computeThisObject();
      if (value != null) {  // non-static
        ObjectReference reference = (ObjectReference)value;
        if (!hasObjectID(reference.uniqueID())) {
          return false;
        }
      }
    }

    if (isClassFiltersEnabled() &&
        !typeMatchesClassFilters(calculateEventClass(context, event), getClassFilters(), getClassExclusionFilters())) {
      return false;
    }

    if (isConditionEnabled()) {
      TextWithImports condition = getCondition();
      if (condition.isEmpty()) {
        return true;
      }

      if (frame != null) {
        Location location = frame.location();
        if (location != null) {
          ThreeState result = debugProcess.getPositionManager().evaluateCondition(context, frame, location, condition.getText());
          if (result != ThreeState.UNSURE) {
            return result == ThreeState.YES;
          }
        }
      }

      ExpressionEvaluator evaluator = null;
      try {
        SourcePosition contextSourcePosition = ContextUtil.getSourcePosition(context);
        evaluator = DebuggerInvocationUtil.commitAndRunReadAction(myProject, () -> {
          // IMPORTANT: calculate context psi element basing on the location where the exception
          // has been hit, not on the location where it was set. (For line breakpoints these locations are the same, however,
          // for method, exception and field breakpoints these locations differ)
          PsiElement contextElement = ContextUtil.getContextElement(contextSourcePosition);
          PsiElement contextPsiElement = contextElement != null ? contextElement : getEvaluationElement(); // as a last resort
          return EvaluatorCache.cacheOrGet("ConditionEvaluator", event.request(), contextPsiElement, condition,
                                           () -> createExpressionEvaluator(myProject,
                                                                           contextPsiElement,
                                                                           contextSourcePosition,
                                                                             condition,
                                                                           this::createConditionCodeFragment));
        });
        boolean evaluationResult = DebuggerUtilsEx.evaluateBoolean(evaluator, context);
        JavaDebuggerEvaluatorStatisticsCollector.logEvaluationResult(myProject, evaluator, true, XEvaluationOrigin.BREAKPOINT_CONDITION);
        if (!evaluationResult) {
          return false;
        }
      }
      catch (EvaluateException ex) {
        if (ex.getCause() instanceof VMDisconnectedException) {
          return false;
        }
        JavaDebuggerEvaluatorStatisticsCollector.logEvaluationResult(myProject, evaluator, false, XEvaluationOrigin.BREAKPOINT_CONDITION);
        throw EvaluateExceptionUtil.createEvaluateException(
          JavaDebuggerBundle.message("error.failed.evaluating.breakpoint.condition", condition, ex.getMessage())
        );
      }
    }
    if (isCountFilterEnabled() && isConditionEnabled()) {
      long hitCount = ObjectUtils.notNull((Long)event.request().getProperty(HIT_COUNTER), 0L) + 1;
      event.request().putProperty(HIT_COUNTER, hitCount);
      return hitCount % getCountFilter() == 0;
    }
    return true;
  }
public boolean evaluateCondition(final EvaluationContextImpl context, LocatableEvent event)