nus-yam/ex-repair huggingface dataset:
Program: 196165
Project: 196165
Buggy source:
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (!mUpdateMonitor.isDeviceProvisioned()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}

Fixed version (ground truth):
/** 
 * @see android.app.KeyguardManager#exitKeyguardSecurely
 */
public void verifyUnlock(IKeyguardExitCallback callback){
synchronized (this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    if (shouldWaitForProvisioning()) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExternallyEnabled) {
      Log.w(TAG,"String_Node_Str");
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else     if (mExitSecureCallback != null) {
      try {
        callback.onKeyguardExitResult(false);
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
 else {
      mExitSecureCallback=callback;
      verifyUnlockLocked();
    }
  }
}
Program: 196166
Project: 196166
Buggy source:
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final boolean provisioned=mUpdateMonitor.isDeviceProvisioned();
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && !provisioned) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}

Fixed version (ground truth):
/** 
 * Enable the keyguard if the settings are appropriate.
 */
private void doKeyguardLocked(Bundle options){
  if (!mExternallyEnabled) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mStatusBarKeyguardViewManager.isShowing()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  final boolean requireSim=!SystemProperties.getBoolean("String_Node_Str",false);
  final IccCardConstants.State state=mUpdateMonitor.getSimState();
  final boolean lockedOrMissing=state.isPinLocked() || ((state == IccCardConstants.State.ABSENT || state == IccCardConstants.State.PERM_DISABLED) && requireSim);
  if (!lockedOrMissing && shouldWaitForProvisioning()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + "String_Node_Str");
    return;
  }
  if (mLockPatternUtils.isLockScreenDisabled() && !lockedOrMissing) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    return;
  }
  if (mLockPatternUtils.checkVoldPassword()) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    mShowing=false;
    hideLocked();
    return;
  }
  if (DEBUG)   Log.d(TAG,"String_Node_Str");
  showLocked(options);
}
Program: 196168
Project: 196168
Buggy source:
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(true,false);
  updateClipping();
}

Fixed version (ground truth):
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(mAnimate,false);
  updateClipping();
}
Program: 196169
Project: 196169
Buggy source:
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(true,false);
  updateClipping();
}

Fixed version (ground truth):
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(mAnimate,false);
  updateClipping();
}
Program: 196170
Project: 196170
Buggy source:
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(true,false);
  updateClipping();
}

Fixed version (ground truth):
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(mAnimate,false);
  updateClipping();
}
Program: 196172
Project: 196172
Buggy source:
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
private boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}

Fixed version (ground truth):
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
protected boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}
Program: 196173
Project: 196173
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}
Program: 196174
Project: 196174
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}
Program: 196175
Project: 196175
Buggy source:
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
  }
}

Fixed version (ground truth):
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
    mTouchIsClick=true;
    mInitialTouchX=ev.getX();
    mInitialTouchY=ev.getY();
  }
}
Program: 196176
Project: 196176
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView || slidingChild == mSpeedBumpView) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 196177
Project: 196177
Buggy source:
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(true,false);
  updateClipping();
}

Fixed version (ground truth):
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(mAnimate,false);
  updateClipping();
}
Program: 196179
Project: 196179
Buggy source:
/** 
 * @return Whether the specified motion event is actually happening over the content.
 */
private boolean isInContentBounds(MotionEvent event){
  return event.getY() < getHeight() - getEmptyBottomMargin();
}

Fixed version (ground truth):
/** 
 * @return Whether a y coordinate is inside the content.
 */
public boolean isInContentBounds(float y){
  return y < getHeight() - getEmptyBottomMargin();
}
Program: 196180
Project: 196180
Buggy source:
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(true,false);
  updateClipping();
}

Fixed version (ground truth):
public void setActualHeight(int actualHeight){
  mActualHeight=actualHeight;
  selectLayout(mAnimate,false);
  updateClipping();
}
Program: 196182
Project: 196182
Buggy source:
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
private boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}

Fixed version (ground truth):
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
protected boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}
Program: 196183
Project: 196183
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}
Program: 196184
Project: 196184
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}
Program: 196185
Project: 196185
Buggy source:
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
  }
}

Fixed version (ground truth):
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
    mTouchIsClick=true;
    mInitialTouchX=ev.getX();
    mInitialTouchY=ev.getY();
  }
}
Program: 196186
Project: 196186
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView || slidingChild == mSpeedBumpView) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 196188
Project: 196188
Buggy source:
/** 
 * @return Whether the specified motion event is actually happening over the content.
 */
private boolean isInContentBounds(MotionEvent event){
  return event.getY() < getHeight() - getEmptyBottomMargin();
}

Fixed version (ground truth):
/** 
 * @return Whether a y coordinate is inside the content.
 */
public boolean isInContentBounds(float y){
  return y < getHeight() - getEmptyBottomMargin();
}
Program: 196190
Project: 196190
Buggy source:
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
private boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}

Fixed version (ground truth):
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
protected boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}
Program: 196191
Project: 196191
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}
Program: 196192
Project: 196192
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}
Program: 196193
Project: 196193
Buggy source:
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
  }
}

Fixed version (ground truth):
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
    mTouchIsClick=true;
    mInitialTouchX=ev.getX();
    mInitialTouchY=ev.getY();
  }
}
Program: 196194
Project: 196194
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView || slidingChild == mSpeedBumpView) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 196196
Project: 196196
Buggy source:
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
private boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}

Fixed version (ground truth):
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
protected boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}
Program: 196197
Project: 196197
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}
Program: 196198
Project: 196198
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}
Program: 196199
Project: 196199
Buggy source:
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
  }
}

Fixed version (ground truth):
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
    mTouchIsClick=true;
    mInitialTouchX=ev.getX();
    mInitialTouchY=ev.getY();
  }
}
Program: 196200
Project: 196200
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView || slidingChild == mSpeedBumpView) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}
Program: 196202
Project: 196202
Buggy source:
/** 
 * @return Whether the specified motion event is actually happening over the content.
 */
private boolean isInContentBounds(MotionEvent event){
  return event.getY() < getHeight() - getEmptyBottomMargin();
}

Fixed version (ground truth):
/** 
 * @return Whether a y coordinate is inside the content.
 */
public boolean isInContentBounds(float y){
  return y < getHeight() - getEmptyBottomMargin();
}
Program: 196204
Project: 196204
Buggy source:
/** 
 * @return Whether the specified motion event is actually happening over the content.
 */
private boolean isInContentBounds(MotionEvent event){
  return event.getY() < getHeight() - getEmptyBottomMargin();
}

Fixed version (ground truth):
/** 
 * @return Whether a y coordinate is inside the content.
 */
public boolean isInContentBounds(float y){
  return y < getHeight() - getEmptyBottomMargin();
}
Program: 196206
Project: 196206
Buggy source:
/** 
 * @return Whether the specified motion event is actually happening over the content.
 */
private boolean isInContentBounds(MotionEvent event){
  return event.getY() < getHeight() - getEmptyBottomMargin();
}

Fixed version (ground truth):
/** 
 * @return Whether a y coordinate is inside the content.
 */
public boolean isInContentBounds(float y){
  return y < getHeight() - getEmptyBottomMargin();
}
Program: 196208
Project: 196208
Buggy source:
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
private boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}

Fixed version (ground truth):
/** 
 * Gets called when the user performs a click anywhere in the empty area of the panel.
 * @return whether the panel will be expanded after the action performed by this method
 */
protected boolean onEmptySpaceClick(float x){
  if (mHintAnimationRunning) {
    return true;
  }
  if (x < mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(false);
    return true;
  }
 else   if (x > getWidth() - mEdgeTapAreaWidth && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    onEdgeClicked(true);
    return true;
  }
 else {
    return onMiddleClicked();
  }
}
Program: 196209
Project: 196209
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  boolean isCancelOrUp=ev.getActionMasked() == MotionEvent.ACTION_CANCEL || ev.getActionMasked() == MotionEvent.ACTION_UP;
  if (mDelegateToScrollView) {
    if (isCancelOrUp) {
      mDelegateToScrollView=false;
    }
    transformTouchEvent(ev,this,mScrollView);
    return mScrollView.onTouchEvent(ev);
  }
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    if (isCancelOrUp) {
      mExpandHelper.onlyObserveMovements(false);
    }
    boolean wasExpandingBefore=mExpandingNotification;
    expandWantsIt=mExpandHelper.onTouchEvent(ev);
    if (mExpandedInThisMotion && !mExpandingNotification && wasExpandingBefore&& !mDisallowScrollingInThisMotion) {
      dispatchDownEventToScroller(ev);
    }
  }
  boolean scrollerWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification && !mDisallowScrollingInThisMotion) {
    scrollerWantsIt=onScrollTouch(ev);
  }
  boolean horizontalSwipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    horizontalSwipeWantsIt=mSwipeHelper.onTouchEvent(ev);
  }
  return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt|| super.onTouchEvent(ev);
}
Program: 196210
Project: 196210
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  if (mInterceptDelegateEnabled) {
    transformTouchEvent(ev,this,mScrollView);
    if (mScrollView.onInterceptTouchEvent(ev)) {
      mDelegateToScrollView=true;
      removeLongPressCallback();
      return true;
    }
    transformTouchEvent(ev,mScrollView,this);
  }
  initDownStates(ev);
  handleEmptySpaceClick(ev);
  boolean expandWantsIt=false;
  if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) {
    expandWantsIt=mExpandHelper.onInterceptTouchEvent(ev);
  }
  boolean scrollWantsIt=false;
  if (!mSwipingInProgress && !mExpandingNotification) {
    scrollWantsIt=onInterceptTouchEventScroll(ev);
  }
  boolean swipeWantsIt=false;
  if (!mIsBeingDragged && !mExpandingNotification && !mExpandedInThisMotion&& !mOnlyScrollingInThisMotion) {
    swipeWantsIt=mSwipeHelper.onInterceptTouchEvent(ev);
  }
  return swipeWantsIt || scrollWantsIt || expandWantsIt|| super.onInterceptTouchEvent(ev);
}
Program: 196211
Project: 196211
Buggy source:
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
  }
}

Fixed version (ground truth):
private void initDownStates(MotionEvent ev){
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mExpandedInThisMotion=false;
    mOnlyScrollingInThisMotion=!mScroller.isFinished();
    mDisallowScrollingInThisMotion=false;
    mTouchIsClick=true;
    mInitialTouchX=ev.getX();
    mInitialTouchY=ev.getY();
  }
}
Program: 196212
Project: 196212
Buggy source:
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}

Fixed version (ground truth):
public ExpandableView getChildAtPosition(float touchX,float touchY){
  final int count=getChildCount();
  for (int childIdx=0; childIdx < count; childIdx++) {
    ExpandableView slidingChild=(ExpandableView)getChildAt(childIdx);
    if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView || slidingChild == mSpeedBumpView) {
      continue;
    }
    float childTop=slidingChild.getTranslationY();
    float top=childTop + slidingChild.getClipTopAmount();
    float bottom=childTop + slidingChild.getActualHeight();
    int left=0;
    int right=getWidth();
    if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
      return slidingChild;
    }
  }
  return null;
}