nus-yam/ex-repair huggingface dataset:
Program: 197557
Project: 197557
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 197558
Project: 197558
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}
Program: 197559
Project: 197559
Buggy source:
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      mInterceptTouches=false;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      mInterceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mInterceptTouches=false;
break;
}
return mInterceptTouches;
}

Fixed version (ground truth):
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
  boolean interceptTouches=false;
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      interceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return interceptTouches;
}
Program: 197560
Project: 197560
Buggy source:
public boolean onTouchEvent(MotionEvent event){
  if (!mInterceptTouches)   return false;
  return mTaskSwitcherDetector.onTouchEvent(event);
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent event){
  return mTaskSwitcherDetector.onTouchEvent(event);
}
Program: 197561
Project: 197561
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 197562
Project: 197562
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 197563
Project: 197563
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}
Program: 197564
Project: 197564
Buggy source:
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      mInterceptTouches=false;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      mInterceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mInterceptTouches=false;
break;
}
return mInterceptTouches;
}

Fixed version (ground truth):
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
  boolean interceptTouches=false;
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      interceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return interceptTouches;
}
Program: 197565
Project: 197565
Buggy source:
public boolean onTouchEvent(MotionEvent event){
  if (!mInterceptTouches)   return false;
  return mTaskSwitcherDetector.onTouchEvent(event);
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent event){
  return mTaskSwitcherDetector.onTouchEvent(event);
}
Program: 197566
Project: 197566
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 197567
Project: 197567
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 197568
Project: 197568
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}
Program: 197569
Project: 197569
Buggy source:
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      mInterceptTouches=false;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      mInterceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mInterceptTouches=false;
break;
}
return mInterceptTouches;
}

Fixed version (ground truth):
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
  boolean interceptTouches=false;
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      interceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return interceptTouches;
}
Program: 197570
Project: 197570
Buggy source:
public boolean onTouchEvent(MotionEvent event){
  if (!mInterceptTouches)   return false;
  return mTaskSwitcherDetector.onTouchEvent(event);
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent event){
  return mTaskSwitcherDetector.onTouchEvent(event);
}
Program: 197571
Project: 197571
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 197572
Project: 197572
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 197573
Project: 197573
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}
Program: 197574
Project: 197574
Buggy source:
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      mInterceptTouches=false;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      mInterceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mInterceptTouches=false;
break;
}
return mInterceptTouches;
}

Fixed version (ground truth):
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
  boolean interceptTouches=false;
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      interceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return interceptTouches;
}
Program: 197575
Project: 197575
Buggy source:
public boolean onTouchEvent(MotionEvent event){
  if (!mInterceptTouches)   return false;
  return mTaskSwitcherDetector.onTouchEvent(event);
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent event){
  return mTaskSwitcherDetector.onTouchEvent(event);
}
Program: 197576
Project: 197576
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab,boolean triggeredFromHomeKey){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
      intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY,triggeredFromHomeKey);
      mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    }
  }
}
Program: 197577
Project: 197577
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 197578
Project: 197578
Buggy source:
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}

Fixed version (ground truth):
/** 
 * OnAnimationStartedListener Implementation 
 */
@Override public void onAnimationStarted(){
  if (!mStartAnimationTriggered) {
    BroadcastReceiver fallbackReceiver=new BroadcastReceiver(){
      @Override public void onReceive(      Context context,      Intent intent){
        if (getResultCode() == Activity.RESULT_OK) {
          mStartAnimationTriggered=true;
          return;
        }
        mHandler.postDelayed(new Runnable(){
          @Override public void run(){
            onAnimationStarted();
          }
        }
,75);
      }
    }
;
    Intent intent=new Intent(ACTION_START_ENTER_ANIMATION);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendOrderedBroadcastAsUser(intent,UserHandle.CURRENT,null,fallbackReceiver,null,Activity.RESULT_CANCELED,null,null);
  }
}
Program: 197579
Project: 197579
Buggy source:
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      mInterceptTouches=false;
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      mInterceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mInterceptTouches=false;
break;
}
return mInterceptTouches;
}

Fixed version (ground truth):
public boolean onInterceptTouchEvent(MotionEvent event){
  mTaskSwitcherDetector.onTouchEvent(event);
  int action=event.getAction();
  boolean interceptTouches=false;
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
{
      mTouchDownX=(int)event.getX();
      mTouchDownY=(int)event.getY();
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    int x=(int)event.getX();
    int y=(int)event.getY();
    int xDiff=Math.abs(x - mTouchDownX);
    int yDiff=Math.abs(y - mTouchDownY);
    boolean exceededTouchSlop=!mIsVertical ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff;
    if (exceededTouchSlop) {
      interceptTouches=true;
      return true;
    }
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return interceptTouches;
}
Program: 197580
Project: 197580
Buggy source:
public boolean onTouchEvent(MotionEvent event){
  if (!mInterceptTouches)   return false;
  return mTaskSwitcherDetector.onTouchEvent(event);
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent event){
  return mTaskSwitcherDetector.onTouchEvent(event);
}
Program: 197581
Project: 197581
Buggy source:
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}

Fixed version (ground truth):
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this) && (v != mActionButtonView);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}
Program: 197582
Project: 197582
Buggy source:
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}

Fixed version (ground truth):
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this) && (v != mActionButtonView);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}
Program: 197583
Project: 197583
Buggy source:
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}

Fixed version (ground truth):
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this) && (v != mActionButtonView);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}
Program: 197584
Project: 197584
Buggy source:
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}

Fixed version (ground truth):
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this) && (v != mActionButtonView);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}
Program: 197585
Project: 197585
Buggy source:
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}

Fixed version (ground truth):
/** 
 * View.OnClickListener Implementation 
 */
@Override public void onClick(final View v){
  final TaskView tv=this;
  final boolean delayViewClick=(v != this) && (v != mActionButtonView);
  if (delayViewClick) {
    postDelayed(new Runnable(){
      @Override public void run(){
        if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) {
          mCb.onTaskViewAppIconClicked(tv);
        }
 else         if (v == mHeaderView.mDismissButton) {
          dismissTask();
        }
      }
    }
,125);
  }
 else {
    if (v == mActionButtonView) {
      mActionButtonView.setTranslationZ(0f);
    }
    mCb.onTaskViewClicked(tv,tv.getTask(),(v == mFooterView || v == mActionButtonView));
  }
}
Program: 197586
Project: 197586
Buggy source:
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  if (entry.row != null) {
    entry.row.resetHeight();
  }
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}

Fixed version (ground truth):
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
  entry.row.resetHeight();
}
Program: 197587
Project: 197587
Buggy source:
@Override protected void onViewAdded(View child){
  super.onViewAdded(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  ((ExpandableView)child).setOnHeightChangedListener(this);
  generateAddAnimation(child,false);
  updateAnimationState(mAnimationsEnabled && mIsExpanded,child);
}

Fixed version (ground truth):
@Override protected void onViewAdded(View child){
  super.onViewAdded(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  ((ExpandableView)child).setOnHeightChangedListener(this);
  generateAddAnimation(child,false);
  updateAnimationState(child);
}
Program: 197588
Project: 197588
Buggy source:
@Override public void onReset(ExpandableView view){
  if (mIsExpanded && mAnimationsEnabled) {
    mRequestViewResizeAnimationOnLayout=true;
  }
  mStackScrollAlgorithm.onReset(view);
}

Fixed version (ground truth):
@Override public void onReset(ExpandableView view){
  if (mIsExpanded && mAnimationsEnabled) {
    mRequestViewResizeAnimationOnLayout=true;
  }
  mStackScrollAlgorithm.onReset(view);
  updateAnimationState(view);
}
Program: 197589
Project: 197589
Buggy source:
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  if (entry.row != null) {
    entry.row.resetHeight();
  }
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}

Fixed version (ground truth):
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
  entry.row.resetHeight();
}
Program: 197590
Project: 197590
Buggy source:
@Override protected void onViewAdded(View child){
  super.onViewAdded(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  ((ExpandableView)child).setOnHeightChangedListener(this);
  generateAddAnimation(child,false);
  updateAnimationState(mAnimationsEnabled && mIsExpanded,child);
}

Fixed version (ground truth):
@Override protected void onViewAdded(View child){
  super.onViewAdded(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  ((ExpandableView)child).setOnHeightChangedListener(this);
  generateAddAnimation(child,false);
  updateAnimationState(child);
}
Program: 197591
Project: 197591
Buggy source:
@Override public void onReset(ExpandableView view){
  if (mIsExpanded && mAnimationsEnabled) {
    mRequestViewResizeAnimationOnLayout=true;
  }
  mStackScrollAlgorithm.onReset(view);
}

Fixed version (ground truth):
@Override public void onReset(ExpandableView view){
  if (mIsExpanded && mAnimationsEnabled) {
    mRequestViewResizeAnimationOnLayout=true;
  }
  mStackScrollAlgorithm.onReset(view);
  updateAnimationState(view);
}