Program: 157473
Project: 157473
Buggy source:
public boolean onScroll(MotionEvent e1,MotionEvent e2,float distanceX,float distanceY){
  final float scrollXDistance=Math.abs(e2.getX() - e1.getX());
  final float scrollYDistance=Math.abs(e2.getY() - e1.getY());
  final float totalScrollTime=((float)(e2.getEventTime() - e1.getEventTime()));
  final float velocityX=1000 * Math.abs(scrollXDistance / totalScrollTime);
  final float velocityY=1000 * Math.abs(scrollYDistance / totalScrollTime);
  Log.d(TAG,"String_Node_Str",scrollXDistance,scrollYDistance,velocityX,velocityY);
  if (velocityX > velocityY) {
    Log.v(TAG,"String_Node_Str");
    if (velocityX > mKeyboardView.mSwipeVelocityThreshold) {
      Log.v(TAG,"String_Node_Str");
      final int swipeXDistance=mKeyboardView.isFirstDownEventInsideSpaceBar() ? mKeyboardView.mSwipeSpaceXDistanceThreshold : mKeyboardView.mSwipeXDistanceThreshold;
      if (scrollXDistance > swipeXDistance) {
        Log.v(TAG,"String_Node_Str");
        if (e2.getX() > e1.getX()) {
          mKeyboardView.mKeyboardActionListener.onSwipeRight(mKeyboardView.isFirstDownEventInsideSpaceBar(),mKeyboardView.isAtTwoFingersState());
        }
 else {
          mKeyboardView.mKeyboardActionListener.onSwipeLeft(mKeyboardView.isFirstDownEventInsideSpaceBar(),mKeyboardView.isAtTwoFingersState());
        }
        return true;
      }
    }
  }
 else {
    Log.v(TAG,"String_Node_Str");
    if (velocityX > mKeyboardView.mSwipeVelocityThreshold) {
      Log.v(TAG,"String_Node_Str");
      if (scrollYDistance > mKeyboardView.mSwipeYDistanceThreshold) {
        Log.v(TAG,"String_Node_Str");
        if (e2.getY() > e1.getY()) {
          mKeyboardView.mKeyboardActionListener.onSwipeDown(mKeyboardView.isFirstDownEventInsideSpaceBar());
        }
 else {
          mKeyboardView.mKeyboardActionListener.onSwipeUp(mKeyboardView.isFirstDownEventInsideSpaceBar());
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean onScroll(MotionEvent e1,MotionEvent e2,float distanceX,float distanceY){
  final float scrollXDistance=Math.abs(e2.getX() - e1.getX());
  final float scrollYDistance=Math.abs(e2.getY() - e1.getY());
  final float totalScrollTime=((float)(e2.getEventTime() - e1.getEventTime()));
  final float velocityX=1000 * Math.abs(scrollXDistance / totalScrollTime);
  final float velocityY=1000 * Math.abs(scrollYDistance / totalScrollTime);
  Log.d(TAG,"String_Node_Str",scrollXDistance,scrollYDistance,velocityX,velocityY);
  if (velocityX > velocityY) {
    Log.v(TAG,"String_Node_Str");
    if (velocityX > mKeyboardView.mSwipeVelocityThreshold) {
      Log.v(TAG,"String_Node_Str");
      final int swipeXDistance=mKeyboardView.isFirstDownEventInsideSpaceBar() ? mKeyboardView.mSwipeSpaceXDistanceThreshold : mKeyboardView.mSwipeXDistanceThreshold;
      if (scrollXDistance > swipeXDistance) {
        Log.v(TAG,"String_Node_Str");
        mKeyboardView.disableTouchesTillFingersAreUp();
        if (e2.getX() > e1.getX()) {
          mKeyboardView.mKeyboardActionListener.onSwipeRight(mKeyboardView.isFirstDownEventInsideSpaceBar(),mKeyboardView.isAtTwoFingersState());
        }
 else {
          mKeyboardView.mKeyboardActionListener.onSwipeLeft(mKeyboardView.isFirstDownEventInsideSpaceBar(),mKeyboardView.isAtTwoFingersState());
        }
        return true;
      }
    }
  }
 else {
    Log.v(TAG,"String_Node_Str");
    if (velocityX > mKeyboardView.mSwipeVelocityThreshold) {
      Log.v(TAG,"String_Node_Str");
      if (scrollYDistance > mKeyboardView.mSwipeYDistanceThreshold) {
        mKeyboardView.disableTouchesTillFingersAreUp();
        Log.v(TAG,"String_Node_Str");
        if (e2.getY() > e1.getY()) {
          mKeyboardView.mKeyboardActionListener.onSwipeDown(mKeyboardView.isFirstDownEventInsideSpaceBar());
        }
 else {
          mKeyboardView.mKeyboardActionListener.onSwipeUp(mKeyboardView.isFirstDownEventInsideSpaceBar());
        }
        return true;
      }
    }
  }
  return false;
}