Program: 171990
Project: 171990
Buggy source:
private void doScroll(int dy){
  if (!isLastScrollComplete)   return;
  if (isRefreshingOrLoading())   return;
  if (dy > 0) {
    if (showBottom) {
      if (mBottomView != null)       ((View)mBottomView).setVisibility(VISIBLE);
      if (mFooterView != null)       ((View)mFooterView).setVisibility(GONE);
      if (getScrollY() < 0) {
        if (Math.abs(getScrollY()) < effectivePullDownRange) {
          if (currentState != State.PULL_DOWN)           updateStatus(State.PULL_DOWN);
        }
      }
 else {
        if (!pullUpEnable)         return;
        int bHeight=0;
        if (mBottomView != null)         bHeight=((View)mBottomView).getMeasuredHeight();
        if (Math.abs(getScrollY()) >= bHeight)         return;
        dy/=computeInterpolationFactor(getScrollY());
        updateStatus(State.BOTTOM);
      }
    }
 else {
      if (mBottomView != null)       ((View)mBottomView).setVisibility(GONE);
      if (mFooterView != null)       ((View)mFooterView).setVisibility(VISIBLE);
      if (getScrollY() < 0) {
        if (Math.abs(getScrollY()) < effectivePullDownRange) {
          if (currentState != State.PULL_DOWN)           updateStatus(State.PULL_DOWN);
        }
      }
 else {
        if (!pullUpEnable)         return;
        if (Math.abs(getScrollY()) >= effectivePullUpRange) {
          dy/=computeInterpolationFactor(getScrollY());
          if (currentState != State.PULL_UP_RELEASABLE)           updateStatus(State.PULL_UP_RELEASABLE);
        }
 else {
          if (currentState != State.PULL_UP)           updateStatus(State.PULL_UP);
        }
      }
    }
  }
 else {
    if (getScrollY() > 0) {
      if (Math.abs(getScrollY()) < effectivePullUpRange) {
        if (currentState != State.PULL_UP)         updateStatus(State.PULL_UP);
      }
    }
 else {
      if (!pullDownEnable)       return;
      if (Math.abs(getScrollY()) >= effectivePullDownRange) {
        dy/=computeInterpolationFactor(getScrollY());
        if (currentState != State.PULL_DOWN_RELEASABLE)         updateStatus(State.PULL_DOWN_RELEASABLE);
      }
 else {
        if (currentState != State.PULL_DOWN)         updateStatus(State.PULL_DOWN);
      }
    }
  }
  dy/=DECELERATE_INTERPOLATION_FACTOR;
  scrollBy(0,dy);
}

Fixed version (ground truth):
private void doScroll(int dy){
  if (!isLastScrollComplete)   return;
  if (isRefreshingOrLoading())   return;
  if (dy > 0) {
    if (showBottom) {
      if (mBottomView != null)       mBottomView.setVisibility(VISIBLE);
      if (mFooterView != null)       mFooterView.setVisibility(GONE);
      if (getScrollY() < 0) {
        if (Math.abs(getScrollY()) < effectivePullDownRange) {
          if (currentState != State.PULL_DOWN)           updateStatus(State.PULL_DOWN);
        }
      }
 else {
        if (!pullUpEnable)         return;
        int bHeight=0;
        if (mBottomView != null)         bHeight=mBottomView.getMeasuredHeight();
        if (Math.abs(getScrollY()) >= bHeight)         return;
        dy/=computeInterpolationFactor(getScrollY());
        updateStatus(State.BOTTOM);
      }
    }
 else {
      if (mFooterView == null)       return;
      if (mBottomView != null)       mBottomView.setVisibility(GONE);
      if (mFooterView != null)       mFooterView.setVisibility(VISIBLE);
      if (getScrollY() < 0) {
        if (Math.abs(getScrollY()) < effectivePullDownRange) {
          if (currentState != State.PULL_DOWN)           updateStatus(State.PULL_DOWN);
        }
      }
 else {
        if (!pullUpEnable)         return;
        if (Math.abs(getScrollY()) >= effectivePullUpRange) {
          dy/=computeInterpolationFactor(getScrollY());
          if (currentState != State.PULL_UP_RELEASABLE)           updateStatus(State.PULL_UP_RELEASABLE);
        }
 else {
          if (currentState != State.PULL_UP)           updateStatus(State.PULL_UP);
        }
      }
    }
  }
 else {
    if (getScrollY() > 0) {
      if (Math.abs(getScrollY()) < effectivePullUpRange) {
        if (currentState != State.PULL_UP)         updateStatus(State.PULL_UP);
      }
    }
 else {
      if (!pullDownEnable)       return;
      if (Math.abs(getScrollY()) >= effectivePullDownRange) {
        dy/=computeInterpolationFactor(getScrollY());
        if (currentState != State.PULL_DOWN_RELEASABLE)         updateStatus(State.PULL_DOWN_RELEASABLE);
      }
 else {
        if (currentState != State.PULL_DOWN)         updateStatus(State.PULL_DOWN);
      }
    }
  }
  dy/=DECELERATE_INTERPOLATION_FACTOR;
  scrollBy(0,dy);
}