Program: 1254
Project: 1254
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isEnabled()) {
    return isClickable() || isLongClickable();
  }
  if (mPositionScroller != null) {
    mPositionScroller.stop();
  }
  if (!mIsAttached) {
    return false;
  }
  if (mFastScroller != null) {
    boolean intercepted=mFastScroller.onTouchEvent(ev);
    if (intercepted) {
      return true;
    }
  }
  initVelocityTrackerIfNotExists();
  mVelocityTracker.addMovement(ev);
  final int actionMasked=ev.getActionMasked();
switch (actionMasked) {
case MotionEvent.ACTION_DOWN:
{
      onTouchDown(ev);
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    onTouchMove(ev);
    break;
  }
case MotionEvent.ACTION_UP:
{
  onTouchUp(ev);
  break;
}
case MotionEvent.ACTION_CANCEL:
{
onTouchCancel();
break;
}
case MotionEvent.ACTION_POINTER_UP:
{
onSecondaryPointerUp(ev);
final int x=mMotionX;
final int y=mMotionY;
final int motionPosition=pointToPosition(x,y);
if (motionPosition >= 0) {
final View child=getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop=child.getTop();
mMotionPosition=motionPosition;
}
mLastY=y;
break;
}
case MotionEvent.ACTION_POINTER_DOWN:
{
final int index=ev.getActionIndex();
final int id=ev.getPointerId(index);
final int x=(int)ev.getX(index);
final int y=(int)ev.getY(index);
mMotionCorrection=0;
mActivePointerId=id;
mMotionX=x;
mMotionY=y;
final int motionPosition=pointToPosition(x,y);
if (motionPosition >= 0) {
final View child=getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop=child.getTop();
mMotionPosition=motionPosition;
}
mLastY=y;
break;
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isEnabled()) {
    return isClickable() || isLongClickable();
  }
  if (mPositionScroller != null) {
    mPositionScroller.stop();
  }
  if (!isAttachedToWindow()) {
    return false;
  }
  if (mFastScroller != null) {
    boolean intercepted=mFastScroller.onTouchEvent(ev);
    if (intercepted) {
      return true;
    }
  }
  initVelocityTrackerIfNotExists();
  mVelocityTracker.addMovement(ev);
  final int actionMasked=ev.getActionMasked();
switch (actionMasked) {
case MotionEvent.ACTION_DOWN:
{
      onTouchDown(ev);
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    onTouchMove(ev);
    break;
  }
case MotionEvent.ACTION_UP:
{
  onTouchUp(ev);
  break;
}
case MotionEvent.ACTION_CANCEL:
{
onTouchCancel();
break;
}
case MotionEvent.ACTION_POINTER_UP:
{
onSecondaryPointerUp(ev);
final int x=mMotionX;
final int y=mMotionY;
final int motionPosition=pointToPosition(x,y);
if (motionPosition >= 0) {
final View child=getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop=child.getTop();
mMotionPosition=motionPosition;
}
mLastY=y;
break;
}
case MotionEvent.ACTION_POINTER_DOWN:
{
final int index=ev.getActionIndex();
final int id=ev.getPointerId(index);
final int x=(int)ev.getX(index);
final int y=(int)ev.getY(index);
mMotionCorrection=0;
mActivePointerId=id;
mMotionX=x;
mMotionY=y;
final int motionPosition=pointToPosition(x,y);
if (motionPosition >= 0) {
final View child=getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop=child.getTop();
mMotionPosition=motionPosition;
}
mLastY=y;
break;
}
}
return true;
}