Program: 193586
Project: 193586
Buggy source:
/** 
 * Handles dragging touch events
 * @param ev
 */
private void handleTouchEvent(MotionEvent ev){
  boolean isLandscape=mRv.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
  int action=ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
    mDownPos.set((int)ev.getX(),(int)ev.getY());
  break;
case MotionEvent.ACTION_MOVE:
{
  if (mDragging) {
    int width=mRv.getMeasuredWidth();
    int height=mRv.getMeasuredHeight();
    float evX=ev.getX();
    float evY=ev.getY();
    float x=evX - mDragView.getTopLeftOffset().x;
    float y=evY - mDragView.getTopLeftOffset().y;
    TaskStack.DockState[] dockStates=isLandscape ? DockRegion.LANDSCAPE : DockRegion.PORTRAIT;
    TaskStack.DockState foundDockState=TaskStack.DockState.NONE;
    for (int i=0; i < dockStates.length; i++) {
      TaskStack.DockState state=dockStates[i];
      if (state.touchAreaContainsPoint(width,height,evX,evY)) {
        foundDockState=state;
        break;
      }
    }
    if (mLastDockState != foundDockState) {
      mLastDockState=foundDockState;
      EventBus.getDefault().send(new DragDockStateChangedEvent(mDragTask,foundDockState));
    }
    mDragView.setTranslationX(x);
    mDragView.setTranslationY(y);
  }
  break;
}
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
{
ReferenceCountedTrigger postAnimationTrigger=new ReferenceCountedTrigger(mRv.getContext(),null,null,null);
postAnimationTrigger.increment();
EventBus.getDefault().send(new DragEndEvent(mDragTask,mTaskView,mDragView,mLastDockState,postAnimationTrigger));
postAnimationTrigger.decrement();
break;
}
}
}

Fixed version (ground truth):
/** 
 * Handles dragging touch events
 * @param ev
 */
private void handleTouchEvent(MotionEvent ev){
  boolean isLandscape=mRv.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
  int action=ev.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
    mDownPos.set((int)ev.getX(),(int)ev.getY());
  break;
case MotionEvent.ACTION_MOVE:
{
  if (mDragging) {
    int width=mRv.getMeasuredWidth();
    int height=mRv.getMeasuredHeight();
    float evX=ev.getX();
    float evY=ev.getY();
    float x=evX - mDragView.getTopLeftOffset().x;
    float y=evY - mDragView.getTopLeftOffset().y;
    TaskStack.DockState[] dockStates=isLandscape ? DockRegion.LANDSCAPE : DockRegion.PORTRAIT;
    TaskStack.DockState foundDockState=TaskStack.DockState.NONE;
    for (int i=0; i < dockStates.length; i++) {
      TaskStack.DockState state=dockStates[i];
      if (state.touchAreaContainsPoint(width,height,evX,evY)) {
        foundDockState=state;
        break;
      }
    }
    if (mLastDockState != foundDockState) {
      mLastDockState=foundDockState;
      EventBus.getDefault().send(new DragDockStateChangedEvent(mDragTask,foundDockState));
    }
    mDragView.setTranslationX(x);
    mDragView.setTranslationY(y);
  }
  break;
}
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
{
if (mDragging) {
  ReferenceCountedTrigger postAnimationTrigger=new ReferenceCountedTrigger(mRv.getContext(),null,null,null);
  postAnimationTrigger.increment();
  EventBus.getDefault().send(new DragEndEvent(mDragTask,mTaskView,mDragView,mLastDockState,postAnimationTrigger));
  postAnimationTrigger.decrement();
  break;
}
}
}
}