Program: 43459
Project: 43459
Buggy source:
@Override public boolean onTrackballEvent(MotionEvent ev){
  long time=ev.getEventTime();
  if ((ev.getMetaState() & KeyEvent.META_ALT_ON) != 0) {
    if (ev.getY() > 0)     pageDown(true);
    if (ev.getY() < 0)     pageUp(true);
    return true;
  }
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mPrivateHandler.removeMessages(SWITCH_TO_CLICK);
    mTrackballDown=true;
    if (mNativeClass != 0) {
      nativeRecordButtons(hasFocus() && hasWindowFocus(),true,true);
    }
    if (time - mLastCursorTime <= TRACKBALL_TIMEOUT && !mLastCursorBounds.equals(nativeGetCursorRingBounds())) {
      nativeSelectBestAt(mLastCursorBounds);
    }
    if (DebugFlags.WEB_VIEW) {
      Log.v(LOGTAG,"String_Node_Str" + ev + "String_Node_Str"+ time+ "String_Node_Str"+ mLastCursorTime);
    }
    if (isInTouchMode())     requestFocusFromTouch();
    return false;
  }
  if (ev.getAction() == MotionEvent.ACTION_UP) {
    mPrivateHandler.removeMessages(LONG_PRESS_CENTER);
    mTrackballDown=false;
    mTrackballUpTime=time;
    if (mShiftIsPressed) {
      if (mExtendSelection) {
        commitCopy();
      }
 else {
        mExtendSelection=true;
      }
    }
    if (DebugFlags.WEB_VIEW) {
      Log.v(LOGTAG,"String_Node_Str" + ev + "String_Node_Str"+ time);
    }
    return false;
  }
  if (mMapTrackballToArrowKeys && mShiftIsPressed == false) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return false;
  }
  if (mTouchMode == TOUCH_DOUBLECLICK_MODE) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return true;
  }
  if (mTrackballDown) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return true;
  }
  if (time - mTrackballUpTime < TRACKBALL_TIMEOUT) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return true;
  }
  switchOutDrawHistory();
  if (time - mTrackballLastTime > TRACKBALL_TIMEOUT) {
    if (DebugFlags.WEB_VIEW) {
      Log.v(LOGTAG,"String_Node_Str" + time + "String_Node_Str"+ mTrackballLastTime);
    }
    mTrackballFirstTime=time;
    mTrackballXMove=mTrackballYMove=0;
  }
  mTrackballLastTime=time;
  if (DebugFlags.WEB_VIEW) {
    Log.v(LOGTAG,"String_Node_Str" + ev + "String_Node_Str"+ time);
  }
  mTrackballRemainsX+=ev.getX();
  mTrackballRemainsY+=ev.getY();
  doTrackball(time);
  return true;
}

Fixed version (ground truth):
@Override public boolean onTrackballEvent(MotionEvent ev){
  long time=ev.getEventTime();
  if ((ev.getMetaState() & KeyEvent.META_ALT_ON) != 0) {
    if (ev.getY() > 0)     pageDown(true);
    if (ev.getY() < 0)     pageUp(true);
    return true;
  }
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mPrivateHandler.removeMessages(SWITCH_TO_CLICK);
    mTrackballDown=true;
    if (mNativeClass == 0) {
      return false;
    }
    nativeRecordButtons(hasFocus() && hasWindowFocus(),true,true);
    if (time - mLastCursorTime <= TRACKBALL_TIMEOUT && !mLastCursorBounds.equals(nativeGetCursorRingBounds())) {
      nativeSelectBestAt(mLastCursorBounds);
    }
    if (DebugFlags.WEB_VIEW) {
      Log.v(LOGTAG,"String_Node_Str" + ev + "String_Node_Str"+ time+ "String_Node_Str"+ mLastCursorTime);
    }
    if (isInTouchMode())     requestFocusFromTouch();
    return false;
  }
  if (ev.getAction() == MotionEvent.ACTION_UP) {
    mPrivateHandler.removeMessages(LONG_PRESS_CENTER);
    mTrackballDown=false;
    mTrackballUpTime=time;
    if (mShiftIsPressed) {
      if (mExtendSelection) {
        commitCopy();
      }
 else {
        mExtendSelection=true;
      }
    }
    if (DebugFlags.WEB_VIEW) {
      Log.v(LOGTAG,"String_Node_Str" + ev + "String_Node_Str"+ time);
    }
    return false;
  }
  if (mMapTrackballToArrowKeys && mShiftIsPressed == false) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return false;
  }
  if (mTouchMode == TOUCH_DOUBLECLICK_MODE) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return true;
  }
  if (mTrackballDown) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return true;
  }
  if (time - mTrackballUpTime < TRACKBALL_TIMEOUT) {
    if (DebugFlags.WEB_VIEW)     Log.v(LOGTAG,"String_Node_Str");
    return true;
  }
  switchOutDrawHistory();
  if (time - mTrackballLastTime > TRACKBALL_TIMEOUT) {
    if (DebugFlags.WEB_VIEW) {
      Log.v(LOGTAG,"String_Node_Str" + time + "String_Node_Str"+ mTrackballLastTime);
    }
    mTrackballFirstTime=time;
    mTrackballXMove=mTrackballYMove=0;
  }
  mTrackballLastTime=time;
  if (DebugFlags.WEB_VIEW) {
    Log.v(LOGTAG,"String_Node_Str" + ev + "String_Node_Str"+ time);
  }
  mTrackballRemainsX+=ev.getX();
  mTrackballRemainsY+=ev.getY();
  doTrackball(time);
  return true;
}