public int getNextStepDepth(final SuspendContextImpl context) {
    try {
      Location location = context.getLocation();

      // smart step feature stop check
      if (myMethodFilter != null &&
          location != null &&
          !(myMethodFilter instanceof BreakpointStepMethodFilter) &&
          !isTheSameFrame(context)) {
        if (isProxyMethod(location.method())) { // step into bridge and proxy methods
          return StepRequest.STEP_INTO;
        }
        boolean proxyMatch =
          (myMethodFilter instanceof BasicStepMethodFilter && ((BasicStepMethodFilter)myMethodFilter).proxyCheck(location, context, this));
        if (proxyMatch || myMethodFilter.locationMatches(context.getDebugProcess(), location, context.getFrameProxy())) {
          if (myMethodFilter.getSkipCount() <= myFilterMatchedCount++) {
            myTargetMethodMatched = true;
            return myMethodFilter.onReached(context, this);
          }
        }
      }

      Integer resultDepth = checkCurrentPosition(context, location);
      if (resultDepth != null) {
        return resultDepth.intValue();
      }

      resultDepth = processSteppingFilters(context, location);
      if (resultDepth != null) {
        return resultDepth.intValue();
      }

      // smart step feature
      if (myMethodFilter != null) {
        isTheSameFrame(context); // to set mySteppedOut if needed
        if (!mySteppedOut) {
          return StepRequest.STEP_OUT;
        }
      }
    }
    catch (VMDisconnectedException ignored) {
    }
    catch (EvaluateException e) {
      LOG.error(e);
    }
    return STOP;
  }
public int getNextStepDepth(final SuspendContextImpl context)