Program: 111132
Project: 111132
Buggy source:
@Override public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_IDLE && mCanSlideInIdleScrollState) {
    int midHeader=-mMinHeaderTranslation / 2;
    int midFooter=mMinFooterTranslation / 2;
switch (mQuickReturnType) {
case HEADER:
      if (-mHeaderDiffTotal > 0 && -mHeaderDiffTotal < midHeader) {
        mHeader.setTranslationY(0);
        mHeaderDiffTotal=0;
      }
 else       if (-mHeaderDiffTotal < -mMinHeaderTranslation && -mHeaderDiffTotal >= midHeader) {
        mHeader.setTranslationY(mMinHeaderTranslation);
        mHeaderDiffTotal=mMinHeaderTranslation;
      }
    break;
case FOOTER:
  if (-mFooterDiffTotal > 0 && -mFooterDiffTotal < midFooter) {
    mFooter.setTranslationY(0);
    mFooterDiffTotal=0;
  }
 else   if (-mFooterDiffTotal < mMinFooterTranslation && -mFooterDiffTotal >= midFooter) {
    mFooter.setTranslationY(mMinFooterTranslation);
    mFooterDiffTotal=-mMinFooterTranslation;
  }
break;
case BOTH:
if (-mHeaderDiffTotal > 0 && -mHeaderDiffTotal < midHeader) {
mHeader.setTranslationY(0);
mHeaderDiffTotal=0;
}
 else if (-mHeaderDiffTotal < -mMinHeaderTranslation && -mHeaderDiffTotal >= midHeader) {
mHeader.setTranslationY(mMinHeaderTranslation);
mHeaderDiffTotal=mMinHeaderTranslation;
}
if (-mFooterDiffTotal > 0 && -mFooterDiffTotal < midFooter) {
mFooter.setTranslationY(0);
mFooterDiffTotal=0;
}
 else if (-mFooterDiffTotal < mMinFooterTranslation && -mFooterDiffTotal >= midFooter) {
mFooter.setTranslationY(mMinFooterTranslation);
mFooterDiffTotal=-mMinFooterTranslation;
}
break;
}
}
}

Fixed version (ground truth):
@Override public void onScrollStateChanged(AbsListView view,int scrollState){
  if (scrollState == SCROLL_STATE_IDLE && mCanSlideInIdleScrollState) {
    int midHeader=-mMinHeaderTranslation / 2;
    int midFooter=mMinFooterTranslation / 2;
switch (mQuickReturnType) {
case HEADER:
      if (-mHeaderDiffTotal > 0 && -mHeaderDiffTotal < midHeader) {
        mHeader.setTranslationY(0);
        mHeaderDiffTotal=0;
      }
 else       if (-mHeaderDiffTotal < -mMinHeaderTranslation && -mHeaderDiffTotal >= midHeader) {
        mHeader.setTranslationY(mMinHeaderTranslation);
        mHeaderDiffTotal=mMinHeaderTranslation;
      }
    break;
case FOOTER:
  if (-mFooterDiffTotal > 0 && -mFooterDiffTotal < midFooter) {
    mFooter.setTranslationY(0);
    mFooterDiffTotal=0;
  }
 else   if (-mFooterDiffTotal < mMinFooterTranslation && -mFooterDiffTotal >= midFooter) {
    mFooter.setTranslationY(mMinFooterTranslation);
    mFooterDiffTotal=-mMinFooterTranslation;
  }
break;
case BOTH:
if (-mHeaderDiffTotal > 0 && -mHeaderDiffTotal < midHeader) {
mHeader.setTranslationY(0);
mHeaderDiffTotal=0;
}
 else if (-mHeaderDiffTotal < -mMinHeaderTranslation && -mHeaderDiffTotal >= midHeader) {
mHeader.setTranslationY(mMinHeaderTranslation);
mHeaderDiffTotal=mMinHeaderTranslation;
}
if (-mFooterDiffTotal > 0 && -mFooterDiffTotal < midFooter) {
mFooter.setTranslationY(0);
mFooterDiffTotal=0;
}
 else if (-mFooterDiffTotal < mMinFooterTranslation && -mFooterDiffTotal >= midFooter) {
mFooter.setTranslationY(mMinFooterTranslation);
mFooterDiffTotal=-mMinFooterTranslation;
}
break;
case TWITTER:
if (-mHeaderDiffTotal > 0 && -mHeaderDiffTotal < midHeader) {
mHeader.setTranslationY(0);
mHeaderDiffTotal=0;
}
 else if (-mHeaderDiffTotal < -mMinHeaderTranslation && -mHeaderDiffTotal >= midHeader) {
mHeader.setTranslationY(mMinHeaderTranslation);
mHeaderDiffTotal=mMinHeaderTranslation;
}
if (-mFooterDiffTotal > 0 && -mFooterDiffTotal < midFooter) {
mFooter.setTranslationY(0);
mFooterDiffTotal=0;
}
 else if (-mFooterDiffTotal < mMinFooterTranslation && -mFooterDiffTotal >= midFooter) {
mFooter.setTranslationY(mMinFooterTranslation);
mFooterDiffTotal=-mMinFooterTranslation;
}
break;
}
}
}