Program: 83865
Project: 83865
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isVisible()) {
    return true;
  }
  if (mLocks != 0) {
    return true;
  }
  super.onTouchEvent(ev);
  int x=(int)ev.getX();
  int deltaX;
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    mMotionDownRawX=(int)ev.getRawX();
  mMotionDownRawY=(int)ev.getRawY();
mLastMotionX=x;
mRollo.mReadback.read();
mRollo.mState.newPositionX=ev.getRawX() / Defines.SCREEN_WIDTH_PX;
mRollo.mState.newTouchDown=1;
if (!mRollo.checkClickOK()) {
mRollo.clearSelectedIcon();
}
 else {
mRollo.selectIcon(x,(int)ev.getY(),mRollo.mReadback.posX);
}
mRollo.mState.save();
mRollo.mInvokeMove.execute();
mVelocity=VelocityTracker.obtain();
mVelocity.addMovement(ev);
mStartedScrolling=false;
break;
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_OUTSIDE:
int slop=Math.abs(x - mLastMotionX);
if (!mStartedScrolling && slop < mConfig.getScaledTouchSlop()) {
}
 else {
mRollo.mState.newPositionX=ev.getRawX() / Defines.SCREEN_WIDTH_PX;
mRollo.mState.newTouchDown=1;
mRollo.mInvokeMove.execute();
mStartedScrolling=true;
mRollo.clearSelectedIcon();
deltaX=x - mLastMotionX;
mVelocity.addMovement(ev);
mRollo.mState.save();
mLastMotionX=x;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mRollo.mState.newTouchDown=0;
mRollo.mState.newPositionX=ev.getRawX() / Defines.SCREEN_WIDTH_PX;
if (!mZoomSwipeInProgress) {
mVelocity.computeCurrentVelocity(1000,mConfig.getScaledMaximumFlingVelocity());
mRollo.mState.flingVelocityX=mVelocity.getXVelocity() / Defines.SCREEN_WIDTH_PX;
mRollo.clearSelectedIcon();
mRollo.mState.save();
mRollo.mInvokeFling.execute();
}
 else {
mRollo.mState.save();
mRollo.mInvokeMove.execute();
}
mLastMotionX=-10000;
mVelocity.recycle();
mVelocity=null;
break;
}
return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isVisible()) {
    return true;
  }
  if (mLocks != 0) {
    return true;
  }
  super.onTouchEvent(ev);
  int x=(int)ev.getX();
  int deltaX;
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
    mMotionDownRawX=(int)ev.getRawX();
  mMotionDownRawY=(int)ev.getRawY();
mLastMotionX=x;
mRollo.mReadback.read();
mRollo.mState.newPositionX=ev.getRawX() / Defines.SCREEN_WIDTH_PX;
mRollo.mState.newTouchDown=1;
if (!mRollo.checkClickOK()) {
mRollo.clearSelectedIcon();
}
 else {
mRollo.selectIcon(x,(int)ev.getY(),mRollo.mReadback.posX);
}
mRollo.mState.save();
mRollo.mInvokeMove.execute();
mVelocity=VelocityTracker.obtain();
mVelocity.addMovement(ev);
mStartedScrolling=false;
break;
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_OUTSIDE:
int slopX=Math.abs(x - mLastMotionX);
if (!mStartedScrolling && slopX < mSlopX) {
}
 else {
mRollo.mState.newPositionX=ev.getRawX() / Defines.SCREEN_WIDTH_PX;
mRollo.mState.newTouchDown=1;
mRollo.mInvokeMove.execute();
mStartedScrolling=true;
mRollo.clearSelectedIcon();
deltaX=x - mLastMotionX;
mVelocity.addMovement(ev);
mRollo.mState.save();
mLastMotionX=x;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mRollo.mState.newTouchDown=0;
mRollo.mState.newPositionX=ev.getRawX() / Defines.SCREEN_WIDTH_PX;
if (!mZoomSwipeInProgress) {
mVelocity.computeCurrentVelocity(1000,mMaxFlingVelocity);
mRollo.mState.flingVelocityX=mVelocity.getXVelocity() / Defines.SCREEN_WIDTH_PX;
mRollo.clearSelectedIcon();
mRollo.mState.save();
mRollo.mInvokeFling.execute();
}
 else {
mRollo.mState.save();
mRollo.mInvokeMove.execute();
}
mLastMotionX=-10000;
mVelocity.recycle();
mVelocity=null;
break;
}
return true;
}