Program: 111144
Project: 111144
Buggy source:
@Override public void onScroll(AbsListView listview,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int scrollY=QuickReturnUtils.getScrollY(listview);
  int diff=mPrevScrollY - scrollY;
switch (mQuickReturnType) {
case HEADER:
    if (diff <= 0) {
      mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
    }
 else {
      mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
    }
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB) {
    mHeaderAnim=new TranslateAnimation(0,0,mHeaderDiffTotal,mHeaderDiffTotal);
    mHeaderAnim.setFillAfter(true);
    mHeaderAnim.setDuration(0);
    mHeader.startAnimation(mHeaderAnim);
  }
 else {
    mHeader.setTranslationY(mHeaderDiffTotal);
  }
break;
case FOOTER:
if (diff <= 0) {
mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB) {
mFooterAnim=new TranslateAnimation(0,0,-mFooterDiffTotal,-mFooterDiffTotal);
mFooterAnim.setFillAfter(true);
mFooterAnim.setDuration(0);
mFooter.startAnimation(mFooterAnim);
}
 else {
mFooter.setTranslationY(-mFooterDiffTotal);
}
break;
case BOTH:
default :
break;
}
mPrevScrollY=scrollY;
}

Fixed version (ground truth):
@Override public void onScroll(AbsListView listview,int firstVisibleItem,int visibleItemCount,int totalItemCount){
  int scrollY=QuickReturnUtils.getScrollY(listview);
  int diff=mPrevScrollY - scrollY;
switch (mQuickReturnType) {
case HEADER:
    if (diff <= 0) {
      mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
    }
 else {
      mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
    }
  if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB) {
    mHeaderAnim=new TranslateAnimation(0,0,mHeaderDiffTotal,mHeaderDiffTotal);
    mHeaderAnim.setFillAfter(true);
    mHeaderAnim.setDuration(0);
    mHeader.startAnimation(mHeaderAnim);
  }
 else {
    mHeader.setTranslationY(mHeaderDiffTotal);
  }
break;
case FOOTER:
if (diff <= 0) {
mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB) {
mFooterAnim=new TranslateAnimation(0,0,-mFooterDiffTotal,-mFooterDiffTotal);
mFooterAnim.setFillAfter(true);
mFooterAnim.setDuration(0);
mFooter.startAnimation(mFooterAnim);
}
 else {
mFooter.setTranslationY(-mFooterDiffTotal);
}
break;
case BOTH:
if (diff <= 0) {
mHeaderDiffTotal=Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation);
}
 else {
mHeaderDiffTotal=Math.min(Math.max(mHeaderDiffTotal + diff,mMinHeaderTranslation),0);
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB) {
mHeaderAnim=new TranslateAnimation(0,0,mHeaderDiffTotal,mHeaderDiffTotal);
mHeaderAnim.setFillAfter(true);
mHeaderAnim.setDuration(0);
mHeader.startAnimation(mHeaderAnim);
}
 else {
mHeader.setTranslationY(mHeaderDiffTotal);
}
if (diff <= 0) {
mFooterDiffTotal=Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation);
}
 else {
mFooterDiffTotal=Math.min(Math.max(mFooterDiffTotal + diff,-mMinFooterTranslation),0);
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB) {
mFooterAnim=new TranslateAnimation(0,0,-mFooterDiffTotal,-mFooterDiffTotal);
mFooterAnim.setFillAfter(true);
mFooterAnim.setDuration(0);
mFooter.startAnimation(mFooterAnim);
}
 else {
mFooter.setTranslationY(-mFooterDiffTotal);
}
default :
break;
}
mPrevScrollY=scrollY;
}