nus-yam/ex-repair huggingface dataset:
Program: 2678
Project: 2678
Buggy source:
/** 
 * Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. Call this to check if an area you intend to draw into is clipped out (and therefore you can skip making the draw calls).
 * @param left        The left side of the rectangle to compare with thecurrent clip
 * @param top         The top of the rectangle to compare with the currentclip
 * @param right       The right side of the rectangle to compare with thecurrent clip
 * @param bottom      The bottom of the rectangle to compare with thecurrent clip
 * @param type        true if the rect should be considered antialiased,since that means it may affect a larger area (more pixels) than non-antialiased.
 * @return            true if the rect (transformed by the canvas' matrix)does not intersect with the canvas' clip
 */
public boolean quickReject(float left,float top,float right,float bottom,EdgeType type){
  return native_quickReject(mNativeCanvas,left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. Call this to check if an area you intend to draw into is clipped out (and therefore you can skip making the draw calls).
 * @param left        The left side of the rectangle to compare with thecurrent clip
 * @param top         The top of the rectangle to compare with the currentclip
 * @param right       The right side of the rectangle to compare with thecurrent clip
 * @param bottom      The bottom of the rectangle to compare with thecurrent clip
 * @param type        {@link Canvas.EdgeType#AA} if the path should be considered antialiased,since that means it may affect a larger area (more pixels) than non-antialiased ( {@link Canvas.EdgeType#BW}).
 * @return            true if the rect (transformed by the canvas' matrix)does not intersect with the canvas' clip
 */
public boolean quickReject(float left,float top,float right,float bottom,EdgeType type){
  return native_quickReject(mNativeCanvas,left,top,right,bottom);
}
Program: 2679
Project: 2679
Buggy source:
/** 
 * Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. Call this to check if an area you intend to draw into is clipped out (and therefore you can skip making the draw calls).
 * @param left        The left side of the rectangle to compare with thecurrent clip
 * @param top         The top of the rectangle to compare with the currentclip
 * @param right       The right side of the rectangle to compare with thecurrent clip
 * @param bottom      The bottom of the rectangle to compare with thecurrent clip
 * @param type        true if the rect should be considered antialiased,since that means it may affect a larger area (more pixels) than non-antialiased.
 * @return            true if the rect (transformed by the canvas' matrix)does not intersect with the canvas' clip
 */
public boolean quickReject(float left,float top,float right,float bottom,EdgeType type){
  return native_quickReject(mNativeCanvas,left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. Call this to check if an area you intend to draw into is clipped out (and therefore you can skip making the draw calls).
 * @param left        The left side of the rectangle to compare with thecurrent clip
 * @param top         The top of the rectangle to compare with the currentclip
 * @param right       The right side of the rectangle to compare with thecurrent clip
 * @param bottom      The bottom of the rectangle to compare with thecurrent clip
 * @param type        {@link Canvas.EdgeType#AA} if the path should be considered antialiased,since that means it may affect a larger area (more pixels) than non-antialiased ( {@link Canvas.EdgeType#BW}).
 * @return            true if the rect (transformed by the canvas' matrix)does not intersect with the canvas' clip
 */
public boolean quickReject(float left,float top,float right,float bottom,EdgeType type){
  return native_quickReject(mNativeCanvas,left,top,right,bottom);
}
Program: 2680
Project: 2680
Buggy source:
/** 
 * Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. Call this to check if an area you intend to draw into is clipped out (and therefore you can skip making the draw calls).
 * @param left        The left side of the rectangle to compare with thecurrent clip
 * @param top         The top of the rectangle to compare with the currentclip
 * @param right       The right side of the rectangle to compare with thecurrent clip
 * @param bottom      The bottom of the rectangle to compare with thecurrent clip
 * @param type        true if the rect should be considered antialiased,since that means it may affect a larger area (more pixels) than non-antialiased.
 * @return            true if the rect (transformed by the canvas' matrix)does not intersect with the canvas' clip
 */
public boolean quickReject(float left,float top,float right,float bottom,EdgeType type){
  return native_quickReject(mNativeCanvas,left,top,right,bottom);
}

Fixed version (ground truth):
/** 
 * Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. Call this to check if an area you intend to draw into is clipped out (and therefore you can skip making the draw calls).
 * @param left        The left side of the rectangle to compare with thecurrent clip
 * @param top         The top of the rectangle to compare with the currentclip
 * @param right       The right side of the rectangle to compare with thecurrent clip
 * @param bottom      The bottom of the rectangle to compare with thecurrent clip
 * @param type        {@link Canvas.EdgeType#AA} if the path should be considered antialiased,since that means it may affect a larger area (more pixels) than non-antialiased ( {@link Canvas.EdgeType#BW}).
 * @return            true if the rect (transformed by the canvas' matrix)does not intersect with the canvas' clip
 */
public boolean quickReject(float left,float top,float right,float bottom,EdgeType type){
  return native_quickReject(mNativeCanvas,left,top,right,bottom);
}
Program: 2687
Project: 2687
Buggy source:
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivity(intent);
  }
}

Fixed version (ground truth):
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivityAsUser(intent,new UserHandle(mLockPatternUtils.getCurrentUser()));
  }
}
Program: 2688
Project: 2688
Buggy source:
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivity(intent);
  }
}

Fixed version (ground truth):
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivityAsUser(intent,new UserHandle(mLockPatternUtils.getCurrentUser()));
  }
}
Program: 2689
Project: 2689
Buggy source:
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivity(intent);
  }
}

Fixed version (ground truth):
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivityAsUser(intent,new UserHandle(mLockPatternUtils.getCurrentUser()));
  }
}
Program: 2691
Project: 2691
Buggy source:
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivity(intent);
  }
}

Fixed version (ground truth):
/** 
 * Shows the emergency dialer or returns the user to the existing call.
 */
public void takeEmergencyCallAction(){
  mPowerManager.userActivity(SystemClock.uptimeMillis(),true);
  if (TelephonyManager.getDefault().getCallState() == TelephonyManager.CALL_STATE_OFFHOOK) {
    mLockPatternUtils.resumeCall();
  }
 else {
    Intent intent=new Intent(ACTION_EMERGENCY_DIAL);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    getContext().startActivityAsUser(intent,new UserHandle(mLockPatternUtils.getCurrentUser()));
  }
}
Program: 2700
Project: 2700
Buggy source:
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  if (mActionBarBottom != null) {
    changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  }
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}
Program: 2702
Project: 2702
Buggy source:
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  if (mActionBarBottom != null) {
    changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  }
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}
Program: 2703
Project: 2703
Buggy source:
public void onUiHidden(){
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}

Fixed version (ground truth):
public void onUiHidden(){
  mCallUiHiddenBeforeNextReload=false;
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}
Program: 2705
Project: 2705
Buggy source:
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  mAnimateIconOfFirstTask=animateIconOfFirstTask;
  mWaitingForWindowAnimation=animateIconOfFirstTask;
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}

Fixed version (ground truth):
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  if (show && mCallUiHiddenBeforeNextReload) {
    onUiHidden();
    recentTaskDescriptions=null;
    mAnimateIconOfFirstTask=false;
    mWaitingForWindowAnimation=false;
  }
 else {
    mAnimateIconOfFirstTask=animateIconOfFirstTask;
    mWaitingForWindowAnimation=animateIconOfFirstTask;
  }
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}
Program: 2706
Project: 2706
Buggy source:
public void onGlobalLayout(){
  if (mItemToAnimateInWhenWindowAnimationIsFinished != null) {
    holder.iconView.setAlpha(1f);
    holder.iconView.setTranslationX(0f);
    holder.iconView.setTranslationY(0f);
    holder.labelView.setAlpha(1f);
    holder.labelView.setTranslationX(0f);
    holder.labelView.setTranslationY(0f);
    if (holder.calloutLine != null) {
      holder.calloutLine.setAlpha(1f);
      holder.calloutLine.setTranslationX(0f);
      holder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}

Fixed version (ground truth):
public void onGlobalLayout(){
  ViewHolder oldHolder=mItemToAnimateInWhenWindowAnimationIsFinished;
  if (oldHolder != null) {
    oldHolder.iconView.setAlpha(1f);
    oldHolder.iconView.setTranslationX(0f);
    oldHolder.iconView.setTranslationY(0f);
    oldHolder.labelView.setAlpha(1f);
    oldHolder.labelView.setTranslationX(0f);
    oldHolder.labelView.setTranslationY(0f);
    if (oldHolder.calloutLine != null) {
      oldHolder.calloutLine.setAlpha(1f);
      oldHolder.calloutLine.setTranslationX(0f);
      oldHolder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
Program: 2707
Project: 2707
Buggy source:
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}

Fixed version (ground truth):
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    mCallUiHiddenBeforeNextReload=true;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}
Program: 2709
Project: 2709
Buggy source:
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  if (mActionBarBottom != null) {
    changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  }
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}
Program: 2710
Project: 2710
Buggy source:
public void onUiHidden(){
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}

Fixed version (ground truth):
public void onUiHidden(){
  mCallUiHiddenBeforeNextReload=false;
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}
Program: 2712
Project: 2712
Buggy source:
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  mAnimateIconOfFirstTask=animateIconOfFirstTask;
  mWaitingForWindowAnimation=animateIconOfFirstTask;
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}

Fixed version (ground truth):
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  if (show && mCallUiHiddenBeforeNextReload) {
    onUiHidden();
    recentTaskDescriptions=null;
    mAnimateIconOfFirstTask=false;
    mWaitingForWindowAnimation=false;
  }
 else {
    mAnimateIconOfFirstTask=animateIconOfFirstTask;
    mWaitingForWindowAnimation=animateIconOfFirstTask;
  }
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}
Program: 2713
Project: 2713
Buggy source:
public void onGlobalLayout(){
  if (mItemToAnimateInWhenWindowAnimationIsFinished != null) {
    holder.iconView.setAlpha(1f);
    holder.iconView.setTranslationX(0f);
    holder.iconView.setTranslationY(0f);
    holder.labelView.setAlpha(1f);
    holder.labelView.setTranslationX(0f);
    holder.labelView.setTranslationY(0f);
    if (holder.calloutLine != null) {
      holder.calloutLine.setAlpha(1f);
      holder.calloutLine.setTranslationX(0f);
      holder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}

Fixed version (ground truth):
public void onGlobalLayout(){
  ViewHolder oldHolder=mItemToAnimateInWhenWindowAnimationIsFinished;
  if (oldHolder != null) {
    oldHolder.iconView.setAlpha(1f);
    oldHolder.iconView.setTranslationX(0f);
    oldHolder.iconView.setTranslationY(0f);
    oldHolder.labelView.setAlpha(1f);
    oldHolder.labelView.setTranslationX(0f);
    oldHolder.labelView.setTranslationY(0f);
    if (oldHolder.calloutLine != null) {
      oldHolder.calloutLine.setAlpha(1f);
      oldHolder.calloutLine.setTranslationX(0f);
      oldHolder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
Program: 2714
Project: 2714
Buggy source:
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}

Fixed version (ground truth):
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    mCallUiHiddenBeforeNextReload=true;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}
Program: 2716
Project: 2716
Buggy source:
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  if (mActionBarBottom != null) {
    changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  }
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}
Program: 2717
Project: 2717
Buggy source:
public void onUiHidden(){
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}

Fixed version (ground truth):
public void onUiHidden(){
  mCallUiHiddenBeforeNextReload=false;
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}
Program: 2719
Project: 2719
Buggy source:
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  mAnimateIconOfFirstTask=animateIconOfFirstTask;
  mWaitingForWindowAnimation=animateIconOfFirstTask;
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}

Fixed version (ground truth):
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  if (show && mCallUiHiddenBeforeNextReload) {
    onUiHidden();
    recentTaskDescriptions=null;
    mAnimateIconOfFirstTask=false;
    mWaitingForWindowAnimation=false;
  }
 else {
    mAnimateIconOfFirstTask=animateIconOfFirstTask;
    mWaitingForWindowAnimation=animateIconOfFirstTask;
  }
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}
Program: 2720
Project: 2720
Buggy source:
public void onGlobalLayout(){
  if (mItemToAnimateInWhenWindowAnimationIsFinished != null) {
    holder.iconView.setAlpha(1f);
    holder.iconView.setTranslationX(0f);
    holder.iconView.setTranslationY(0f);
    holder.labelView.setAlpha(1f);
    holder.labelView.setTranslationX(0f);
    holder.labelView.setTranslationY(0f);
    if (holder.calloutLine != null) {
      holder.calloutLine.setAlpha(1f);
      holder.calloutLine.setTranslationX(0f);
      holder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}

Fixed version (ground truth):
public void onGlobalLayout(){
  ViewHolder oldHolder=mItemToAnimateInWhenWindowAnimationIsFinished;
  if (oldHolder != null) {
    oldHolder.iconView.setAlpha(1f);
    oldHolder.iconView.setTranslationX(0f);
    oldHolder.iconView.setTranslationY(0f);
    oldHolder.labelView.setAlpha(1f);
    oldHolder.labelView.setTranslationX(0f);
    oldHolder.labelView.setTranslationY(0f);
    if (oldHolder.calloutLine != null) {
      oldHolder.calloutLine.setAlpha(1f);
      oldHolder.calloutLine.setTranslationX(0f);
      oldHolder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
Program: 2721
Project: 2721
Buggy source:
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}

Fixed version (ground truth):
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    mCallUiHiddenBeforeNextReload=true;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}
Program: 2723
Project: 2723
Buggy source:
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  if (mActionBarBottom != null) {
    changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  }
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}
Program: 2724
Project: 2724
Buggy source:
public void onUiHidden(){
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}

Fixed version (ground truth):
public void onUiHidden(){
  mCallUiHiddenBeforeNextReload=false;
  if (!mShowing && mRecentTaskDescriptions != null) {
    onAnimationEnd(null);
    clearRecentTasksList();
  }
}
Program: 2726
Project: 2726
Buggy source:
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  mAnimateIconOfFirstTask=animateIconOfFirstTask;
  mWaitingForWindowAnimation=animateIconOfFirstTask;
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}

Fixed version (ground truth):
public void show(boolean show,ArrayList<TaskDescription> recentTaskDescriptions,boolean firstScreenful,boolean animateIconOfFirstTask){
  if (show && mCallUiHiddenBeforeNextReload) {
    onUiHidden();
    recentTaskDescriptions=null;
    mAnimateIconOfFirstTask=false;
    mWaitingForWindowAnimation=false;
  }
 else {
    mAnimateIconOfFirstTask=animateIconOfFirstTask;
    mWaitingForWindowAnimation=animateIconOfFirstTask;
  }
  if (show) {
    mWaitingToShow=true;
    refreshRecentTasksList(recentTaskDescriptions,firstScreenful);
    showIfReady();
  }
 else {
    showImpl(false);
  }
}
Program: 2727
Project: 2727
Buggy source:
public void onGlobalLayout(){
  if (mItemToAnimateInWhenWindowAnimationIsFinished != null) {
    holder.iconView.setAlpha(1f);
    holder.iconView.setTranslationX(0f);
    holder.iconView.setTranslationY(0f);
    holder.labelView.setAlpha(1f);
    holder.labelView.setTranslationX(0f);
    holder.labelView.setTranslationY(0f);
    if (holder.calloutLine != null) {
      holder.calloutLine.setAlpha(1f);
      holder.calloutLine.setTranslationX(0f);
      holder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}

Fixed version (ground truth):
public void onGlobalLayout(){
  ViewHolder oldHolder=mItemToAnimateInWhenWindowAnimationIsFinished;
  if (oldHolder != null) {
    oldHolder.iconView.setAlpha(1f);
    oldHolder.iconView.setTranslationX(0f);
    oldHolder.iconView.setTranslationY(0f);
    oldHolder.labelView.setAlpha(1f);
    oldHolder.labelView.setTranslationX(0f);
    oldHolder.labelView.setTranslationY(0f);
    if (oldHolder.calloutLine != null) {
      oldHolder.calloutLine.setAlpha(1f);
      oldHolder.calloutLine.setTranslationX(0f);
      oldHolder.calloutLine.setTranslationY(0f);
    }
  }
  mItemToAnimateInWhenWindowAnimationIsFinished=holder;
  int translation=-getResources().getDimensionPixelSize(R.dimen.status_bar_recents_app_icon_translate_distance);
  final Configuration config=getResources().getConfiguration();
  if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
    if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
      translation=-translation;
    }
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationX(translation);
    holder.labelView.setAlpha(0f);
    holder.labelView.setTranslationX(translation);
    holder.calloutLine.setAlpha(0f);
    holder.calloutLine.setTranslationX(translation);
  }
 else {
    holder.iconView.setAlpha(0f);
    holder.iconView.setTranslationY(translation);
  }
  if (!mWaitingForWindowAnimation) {
    animateInIconOfFirstTask();
  }
  getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
Program: 2728
Project: 2728
Buggy source:
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}

Fixed version (ground truth):
private void showImpl(boolean show){
  sendCloseSystemWindows(mContext,BaseStatusBar.SYSTEM_DIALOG_REASON_RECENT_APPS);
  mShowing=show;
  if (show) {
    boolean noApps=mRecentTaskDescriptions != null && (mRecentTaskDescriptions.size() == 0);
    mRecentsNoApps.setAlpha(1f);
    mRecentsNoApps.setVisibility(noApps ? View.VISIBLE : View.INVISIBLE);
    onAnimationEnd(null);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
  }
 else {
    mWaitingToShow=false;
    mCallUiHiddenBeforeNextReload=true;
    if (mPopup != null) {
      mPopup.dismiss();
    }
  }
}
Program: 2729
Project: 2729
Buggy source:
private boolean applyInsets(View view,Rect insets,boolean left,boolean top,boolean bottom,boolean right){
  boolean changed=false;
  FrameLayout.LayoutParams lp=(FrameLayout.LayoutParams)view.getLayoutParams();
  if (left && lp.leftMargin != insets.left) {
    changed=true;
    lp.leftMargin=insets.left;
  }
  if (top && lp.topMargin != insets.top) {
    changed=true;
    lp.topMargin=insets.top;
  }
  if (right && lp.rightMargin != insets.right) {
    changed=true;
    lp.rightMargin=insets.right;
  }
  if (bottom && lp.bottomMargin != insets.bottom) {
    changed=true;
    lp.bottomMargin=insets.bottom;
  }
  return changed;
}

Fixed version (ground truth):
private boolean applyInsets(View view,Rect insets,boolean left,boolean top,boolean bottom,boolean right){
  boolean changed=false;
  LayoutParams lp=(LayoutParams)view.getLayoutParams();
  if (left && lp.leftMargin != insets.left) {
    changed=true;
    lp.leftMargin=insets.left;
  }
  if (top && lp.topMargin != insets.top) {
    changed=true;
    lp.topMargin=insets.top;
  }
  if (right && lp.rightMargin != insets.right) {
    changed=true;
    lp.rightMargin=insets.right;
  }
  if (bottom && lp.bottomMargin != insets.bottom) {
    changed=true;
    lp.bottomMargin=insets.bottom;
  }
  return changed;
}
Program: 2730
Project: 2730
Buggy source:
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  if (mActionBarBottom != null) {
    changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  }
  int topSpace=0;
  if (stable || mActionBarTop.getVisibility() == VISIBLE) {
    topSpace=mActionBarHeight;
  }
  if (mActionBar != null && mActionBar.hasNonEmbeddedTabs()) {
    View tabs=mContainerView.getTabContainer();
    if (tabs != null && (stable || tabs.getVisibility() == VISIBLE)) {
      topSpace+=mActionBarHeight;
    }
  }
  int bottomSpace=0;
  if (mActionView.isSplitActionBar()) {
    if ((mActionBarBottom != null && (stable || mActionBarBottom.getVisibility() == VISIBLE))) {
      bottomSpace=mActionBarHeight;
    }
  }
  boolean res=computeFitSystemWindows(insets,mLocalInsets);
  if (!mOverlayMode && !stable) {
    mLocalInsets.top+=topSpace;
    mLocalInsets.bottom+=bottomSpace;
  }
 else {
    insets.top+=topSpace;
    insets.bottom+=bottomSpace;
  }
  changed|=applyInsets(mContent,mLocalInsets,true,true,true,true);
  if (changed) {
    requestLayout();
  }
  super.fitSystemWindows(insets);
  return true;
}

Fixed version (ground truth):
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}
Program: 2732
Project: 2732
Buggy source:
private boolean applyInsets(View view,Rect insets,boolean left,boolean top,boolean bottom,boolean right){
  boolean changed=false;
  FrameLayout.LayoutParams lp=(FrameLayout.LayoutParams)view.getLayoutParams();
  if (left && lp.leftMargin != insets.left) {
    changed=true;
    lp.leftMargin=insets.left;
  }
  if (top && lp.topMargin != insets.top) {
    changed=true;
    lp.topMargin=insets.top;
  }
  if (right && lp.rightMargin != insets.right) {
    changed=true;
    lp.rightMargin=insets.right;
  }
  if (bottom && lp.bottomMargin != insets.bottom) {
    changed=true;
    lp.bottomMargin=insets.bottom;
  }
  return changed;
}

Fixed version (ground truth):
private boolean applyInsets(View view,Rect insets,boolean left,boolean top,boolean bottom,boolean right){
  boolean changed=false;
  LayoutParams lp=(LayoutParams)view.getLayoutParams();
  if (left && lp.leftMargin != insets.left) {
    changed=true;
    lp.leftMargin=insets.left;
  }
  if (top && lp.topMargin != insets.top) {
    changed=true;
    lp.topMargin=insets.top;
  }
  if (right && lp.rightMargin != insets.right) {
    changed=true;
    lp.rightMargin=insets.right;
  }
  if (bottom && lp.bottomMargin != insets.bottom) {
    changed=true;
    lp.bottomMargin=insets.bottom;
  }
  return changed;
}
Program: 2733
Project: 2733
Buggy source:
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  if (mActionBarBottom != null) {
    changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  }
  int topSpace=0;
  if (stable || mActionBarTop.getVisibility() == VISIBLE) {
    topSpace=mActionBarHeight;
  }
  if (mActionBar != null && mActionBar.hasNonEmbeddedTabs()) {
    View tabs=mContainerView.getTabContainer();
    if (tabs != null && (stable || tabs.getVisibility() == VISIBLE)) {
      topSpace+=mActionBarHeight;
    }
  }
  int bottomSpace=0;
  if (mActionView.isSplitActionBar()) {
    if ((mActionBarBottom != null && (stable || mActionBarBottom.getVisibility() == VISIBLE))) {
      bottomSpace=mActionBarHeight;
    }
  }
  boolean res=computeFitSystemWindows(insets,mLocalInsets);
  if (!mOverlayMode && !stable) {
    mLocalInsets.top+=topSpace;
    mLocalInsets.bottom+=bottomSpace;
  }
 else {
    insets.top+=topSpace;
    insets.bottom+=bottomSpace;
  }
  changed|=applyInsets(mContent,mLocalInsets,true,true,true,true);
  if (changed) {
    requestLayout();
  }
  super.fitSystemWindows(insets);
  return true;
}

Fixed version (ground truth):
@Override protected boolean fitSystemWindows(Rect insets){
  pullChildren();
  final int vis=getWindowSystemUiVisibility();
  final boolean stable=(vis & SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0;
  boolean changed=applyInsets(mActionBarTop,insets,true,true,false,true);
  changed|=applyInsets(mActionBarBottom,insets,true,false,true,true);
  mBaseInnerInsets.set(insets);
  computeFitSystemWindows(mBaseInnerInsets,mBaseContentInsets);
  if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
    changed=true;
    mLastBaseContentInsets.set(mBaseContentInsets);
  }
  if (changed) {
    requestLayout();
  }
  return true;
}
Program: 2734
Project: 2734
Buggy source:
private boolean applyInsets(View view,Rect insets,boolean left,boolean top,boolean bottom,boolean right){
  boolean changed=false;
  FrameLayout.LayoutParams lp=(FrameLayout.LayoutParams)view.getLayoutParams();
  if (left && lp.leftMargin != insets.left) {
    changed=true;
    lp.leftMargin=insets.left;
  }
  if (top && lp.topMargin != insets.top) {
    changed=true;
    lp.topMargin=insets.top;
  }
  if (right && lp.rightMargin != insets.right) {
    changed=true;
    lp.rightMargin=insets.right;
  }
  if (bottom && lp.bottomMargin != insets.bottom) {
    changed=true;
    lp.bottomMargin=insets.bottom;
  }
  return changed;
}

Fixed version (ground truth):
private boolean applyInsets(View view,Rect insets,boolean left,boolean top,boolean bottom,boolean right){
  boolean changed=false;
  LayoutParams lp=(LayoutParams)view.getLayoutParams();
  if (left && lp.leftMargin != insets.left) {
    changed=true;
    lp.leftMargin=insets.left;
  }
  if (top && lp.topMargin != insets.top) {
    changed=true;
    lp.topMargin=insets.top;
  }
  if (right && lp.rightMargin != insets.right) {
    changed=true;
    lp.rightMargin=insets.right;
  }
  if (bottom && lp.bottomMargin != insets.bottom) {
    changed=true;
    lp.bottomMargin=insets.bottom;
  }
  return changed;
}