nus-yam/ex-repair huggingface dataset:
Program: 192626
Project: 192626
Buggy source:
private void onQsTouch(MotionEvent event){
  int pointerIndex=event.findPointerIndex(mTrackingPointer);
  if (pointerIndex < 0) {
    pointerIndex=0;
    mTrackingPointer=event.getPointerId(pointerIndex);
  }
  final float y=event.getY(pointerIndex);
  final float x=event.getX(pointerIndex);
  final float h=y - mInitialTouchY;
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    mQsTracking=true;
  mInitialTouchY=y;
mInitialTouchX=x;
onQsExpansionStarted();
mInitialHeightOnTouch=mQsExpansionHeight;
initVelocityTracker();
trackMovement(event);
break;
case MotionEvent.ACTION_POINTER_UP:
final int upPointer=event.getPointerId(event.getActionIndex());
if (mTrackingPointer == upPointer) {
final int newIndex=event.getPointerId(0) != upPointer ? 0 : 1;
final float newY=event.getY(newIndex);
final float newX=event.getX(newIndex);
mTrackingPointer=event.getPointerId(newIndex);
mInitialHeightOnTouch=mQsExpansionHeight;
mInitialTouchY=newY;
mInitialTouchX=newX;
}
break;
case MotionEvent.ACTION_MOVE:
setQsExpansion(h + mInitialHeightOnTouch);
if (h >= getFalsingThreshold()) {
mQsTouchAboveFalsingThreshold=true;
}
trackMovement(event);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mQsTracking=false;
mTrackingPointer=-1;
trackMovement(event);
flingQsWithCurrentVelocity(y,event.getActionMasked() == MotionEvent.ACTION_CANCEL);
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
break;
}
}

Fixed version (ground truth):
private void onQsTouch(MotionEvent event){
  int pointerIndex=event.findPointerIndex(mTrackingPointer);
  if (pointerIndex < 0) {
    pointerIndex=0;
    mTrackingPointer=event.getPointerId(pointerIndex);
  }
  final float y=event.getY(pointerIndex);
  final float x=event.getX(pointerIndex);
  final float h=y - mInitialTouchY;
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    mQsTracking=true;
  mInitialTouchY=y;
mInitialTouchX=x;
onQsExpansionStarted();
mInitialHeightOnTouch=mQsExpansionHeight;
initVelocityTracker();
trackMovement(event);
break;
case MotionEvent.ACTION_POINTER_UP:
final int upPointer=event.getPointerId(event.getActionIndex());
if (mTrackingPointer == upPointer) {
final int newIndex=event.getPointerId(0) != upPointer ? 0 : 1;
final float newY=event.getY(newIndex);
final float newX=event.getX(newIndex);
mTrackingPointer=event.getPointerId(newIndex);
mInitialHeightOnTouch=mQsExpansionHeight;
mInitialTouchY=newY;
mInitialTouchX=newX;
}
break;
case MotionEvent.ACTION_MOVE:
setQsExpansion(h + mInitialHeightOnTouch);
if (h >= getFalsingThreshold()) {
mQsTouchAboveFalsingThreshold=true;
}
trackMovement(event);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mQsTracking=false;
mTrackingPointer=-1;
trackMovement(event);
float fraction=getQsExpansionFraction();
if (fraction != 0f || y >= mInitialTouchY) {
flingQsWithCurrentVelocity(y,event.getActionMasked() == MotionEvent.ACTION_CANCEL);
}
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
break;
}
}
Program: 192627
Project: 192627
Buggy source:
/** 
 * Whether key will, by default, trigger a click on the focused view.
 * @hide
 */
public static final boolean isConfirmKey(int keyCode){
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_SPACE:
    return true;
default :
  return false;
}
}

Fixed version (ground truth):
/** 
 * Whether key will, by default, trigger a click on the focused view.
 * @hide
 */
public static final boolean isConfirmKey(int keyCode){
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
    return true;
default :
  return false;
}
}
Program: 192628
Project: 192628
Buggy source:
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (KeyEvent.isConfirmKey(keyCode)) {
    performClick(mOkButton);
    return true;
  }
 else   if (keyCode == KeyEvent.KEYCODE_DEL) {
    performClick(mDeleteButton);
    return true;
  }
  if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) {
    int number=keyCode - KeyEvent.KEYCODE_0;
    performNumberClick(number);
    return true;
  }
  return super.onKeyDown(keyCode,event);
}

Fixed version (ground truth):
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (KeyEvent.isConfirmKey(keyCode)) {
    performClick(mOkButton);
    return true;
  }
 else   if (keyCode == KeyEvent.KEYCODE_DEL) {
    performClick(mDeleteButton);
    return true;
  }
  if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) {
    int number=keyCode - KeyEvent.KEYCODE_0;
    performNumberClick(number);
    return true;
  }
  if (keyCode >= KeyEvent.KEYCODE_NUMPAD_0 && keyCode <= KeyEvent.KEYCODE_NUMPAD_9) {
    int number=keyCode - KeyEvent.KEYCODE_NUMPAD_0;
    performNumberClick(number);
    return true;
  }
  return super.onKeyDown(keyCode,event);
}
Program: 192629
Project: 192629
Buggy source:
protected void updatePublicContentView(Entry entry,StatusBarNotification sbn){
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  if (publicContentView != null && entry.getPublicContentView() != null) {
    final boolean disabledByPolicy=!adminAllowsUnredactedNotifications(entry.notification.getUserId());
    publicContentView.setTextViewText(android.R.id.title,mContext.getString(disabledByPolicy ? com.android.internal.R.string.notification_hidden_by_policy_text : com.android.internal.R.string.notification_hidden_text));
    publicContentView.reapply(sbn.getPackageContext(mContext),entry.getPublicContentView(),mOnClickHandler);
  }
}

Fixed version (ground truth):
protected void updatePublicContentView(Entry entry,StatusBarNotification sbn){
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  View inflatedView=entry.getPublicContentView();
  if (entry.autoRedacted && publicContentView != null && inflatedView != null) {
    final boolean disabledByPolicy=!adminAllowsUnredactedNotifications(entry.notification.getUserId());
    String notificationHiddenText=mContext.getString(disabledByPolicy ? com.android.internal.R.string.notification_hidden_by_policy_text : com.android.internal.R.string.notification_hidden_text);
    TextView titleView=(TextView)inflatedView.findViewById(android.R.id.title);
    if (titleView != null && !titleView.getText().toString().equals(notificationHiddenText)) {
      publicContentView.setTextViewText(android.R.id.title,notificationHiddenText);
      publicContentView.reapply(sbn.getPackageContext(mContext),inflatedView,mOnClickHandler);
      entry.row.onNotificationUpdated(entry);
    }
  }
}
Program: 192630
Project: 192630
Buggy source:
public void setDark(boolean dark,boolean fade,long delay){
  if (mDark == dark || mContractedChild == null)   return;
  mDark=dark;
  dark=dark && !mShowingLegacyBackground;
  if (mVisibleType == VISIBLE_TYPE_CONTRACTED || !dark) {
    mContractedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_EXPANDED || (mExpandedChild != null && !dark)) {
    mExpandedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_HEADSUP || (mHeadsUpChild != null && !dark)) {
    mHeadsUpWrapper.setDark(dark,fade,delay);
  }
  if (mSingleLineView != null && (mVisibleType == VISIBLE_TYPE_SINGLELINE || !dark)) {
    mSingleLineView.setDark(dark,fade,delay);
  }
}

Fixed version (ground truth):
public void setDark(boolean dark,boolean fade,long delay,boolean force){
  if ((!force && mDark == dark) || mContractedChild == null) {
    return;
  }
  mDark=dark;
  dark=dark && !mShowingLegacyBackground;
  if (mVisibleType == VISIBLE_TYPE_CONTRACTED || !dark) {
    mContractedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_EXPANDED || (mExpandedChild != null && !dark)) {
    mExpandedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_HEADSUP || (mHeadsUpChild != null && !dark)) {
    mHeadsUpWrapper.setDark(dark,fade,delay);
  }
  if (mSingleLineView != null && (mVisibleType == VISIBLE_TYPE_SINGLELINE || !dark)) {
    mSingleLineView.setDark(dark,fade,delay);
  }
}
Program: 192631
Project: 192631
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mStatusBarNotification=entry.notification;
  mBeforeN=entry.targetSdk < Build.VERSION_CODES.N;
  updateSingleLineView();
  applyRemoteInput(entry);
  selectLayout(false,true);
  if (mContractedChild != null) {
    mContractedWrapper.notifyContentUpdated(entry.notification);
    mContractedWrapper.setDark(mDark,false,0);
  }
  if (mExpandedChild != null) {
    mExpandedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpWrapper.notifyContentUpdated(entry.notification);
  }
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mStatusBarNotification=entry.notification;
  mBeforeN=entry.targetSdk < Build.VERSION_CODES.N;
  updateSingleLineView();
  applyRemoteInput(entry);
  selectLayout(false,true);
  if (mContractedChild != null) {
    mContractedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mExpandedChild != null) {
    mExpandedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpWrapper.notifyContentUpdated(entry.notification);
  }
  setDark(mDark,false,0,true);
}
Program: 192633
Project: 192633
Buggy source:
private void onQsTouch(MotionEvent event){
  int pointerIndex=event.findPointerIndex(mTrackingPointer);
  if (pointerIndex < 0) {
    pointerIndex=0;
    mTrackingPointer=event.getPointerId(pointerIndex);
  }
  final float y=event.getY(pointerIndex);
  final float x=event.getX(pointerIndex);
  final float h=y - mInitialTouchY;
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    mQsTracking=true;
  mInitialTouchY=y;
mInitialTouchX=x;
onQsExpansionStarted();
mInitialHeightOnTouch=mQsExpansionHeight;
initVelocityTracker();
trackMovement(event);
break;
case MotionEvent.ACTION_POINTER_UP:
final int upPointer=event.getPointerId(event.getActionIndex());
if (mTrackingPointer == upPointer) {
final int newIndex=event.getPointerId(0) != upPointer ? 0 : 1;
final float newY=event.getY(newIndex);
final float newX=event.getX(newIndex);
mTrackingPointer=event.getPointerId(newIndex);
mInitialHeightOnTouch=mQsExpansionHeight;
mInitialTouchY=newY;
mInitialTouchX=newX;
}
break;
case MotionEvent.ACTION_MOVE:
setQsExpansion(h + mInitialHeightOnTouch);
if (h >= getFalsingThreshold()) {
mQsTouchAboveFalsingThreshold=true;
}
trackMovement(event);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mQsTracking=false;
mTrackingPointer=-1;
trackMovement(event);
flingQsWithCurrentVelocity(y,event.getActionMasked() == MotionEvent.ACTION_CANCEL);
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
break;
}
}

Fixed version (ground truth):
private void onQsTouch(MotionEvent event){
  int pointerIndex=event.findPointerIndex(mTrackingPointer);
  if (pointerIndex < 0) {
    pointerIndex=0;
    mTrackingPointer=event.getPointerId(pointerIndex);
  }
  final float y=event.getY(pointerIndex);
  final float x=event.getX(pointerIndex);
  final float h=y - mInitialTouchY;
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    mQsTracking=true;
  mInitialTouchY=y;
mInitialTouchX=x;
onQsExpansionStarted();
mInitialHeightOnTouch=mQsExpansionHeight;
initVelocityTracker();
trackMovement(event);
break;
case MotionEvent.ACTION_POINTER_UP:
final int upPointer=event.getPointerId(event.getActionIndex());
if (mTrackingPointer == upPointer) {
final int newIndex=event.getPointerId(0) != upPointer ? 0 : 1;
final float newY=event.getY(newIndex);
final float newX=event.getX(newIndex);
mTrackingPointer=event.getPointerId(newIndex);
mInitialHeightOnTouch=mQsExpansionHeight;
mInitialTouchY=newY;
mInitialTouchX=newX;
}
break;
case MotionEvent.ACTION_MOVE:
setQsExpansion(h + mInitialHeightOnTouch);
if (h >= getFalsingThreshold()) {
mQsTouchAboveFalsingThreshold=true;
}
trackMovement(event);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mQsTracking=false;
mTrackingPointer=-1;
trackMovement(event);
float fraction=getQsExpansionFraction();
if (fraction != 0f || y >= mInitialTouchY) {
flingQsWithCurrentVelocity(y,event.getActionMasked() == MotionEvent.ACTION_CANCEL);
}
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
break;
}
}
Program: 192634
Project: 192634
Buggy source:
protected void updatePublicContentView(Entry entry,StatusBarNotification sbn){
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  if (publicContentView != null && entry.getPublicContentView() != null) {
    final boolean disabledByPolicy=!adminAllowsUnredactedNotifications(entry.notification.getUserId());
    publicContentView.setTextViewText(android.R.id.title,mContext.getString(disabledByPolicy ? com.android.internal.R.string.notification_hidden_by_policy_text : com.android.internal.R.string.notification_hidden_text));
    publicContentView.reapply(sbn.getPackageContext(mContext),entry.getPublicContentView(),mOnClickHandler);
  }
}

Fixed version (ground truth):
protected void updatePublicContentView(Entry entry,StatusBarNotification sbn){
  final RemoteViews publicContentView=entry.cachedPublicContentView;
  View inflatedView=entry.getPublicContentView();
  if (entry.autoRedacted && publicContentView != null && inflatedView != null) {
    final boolean disabledByPolicy=!adminAllowsUnredactedNotifications(entry.notification.getUserId());
    String notificationHiddenText=mContext.getString(disabledByPolicy ? com.android.internal.R.string.notification_hidden_by_policy_text : com.android.internal.R.string.notification_hidden_text);
    TextView titleView=(TextView)inflatedView.findViewById(android.R.id.title);
    if (titleView != null && !titleView.getText().toString().equals(notificationHiddenText)) {
      publicContentView.setTextViewText(android.R.id.title,notificationHiddenText);
      publicContentView.reapply(sbn.getPackageContext(mContext),inflatedView,mOnClickHandler);
      entry.row.onNotificationUpdated(entry);
    }
  }
}
Program: 192635
Project: 192635
Buggy source:
public void setDark(boolean dark,boolean fade,long delay){
  if (mDark == dark || mContractedChild == null)   return;
  mDark=dark;
  dark=dark && !mShowingLegacyBackground;
  if (mVisibleType == VISIBLE_TYPE_CONTRACTED || !dark) {
    mContractedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_EXPANDED || (mExpandedChild != null && !dark)) {
    mExpandedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_HEADSUP || (mHeadsUpChild != null && !dark)) {
    mHeadsUpWrapper.setDark(dark,fade,delay);
  }
  if (mSingleLineView != null && (mVisibleType == VISIBLE_TYPE_SINGLELINE || !dark)) {
    mSingleLineView.setDark(dark,fade,delay);
  }
}

Fixed version (ground truth):
public void setDark(boolean dark,boolean fade,long delay,boolean force){
  if ((!force && mDark == dark) || mContractedChild == null) {
    return;
  }
  mDark=dark;
  dark=dark && !mShowingLegacyBackground;
  if (mVisibleType == VISIBLE_TYPE_CONTRACTED || !dark) {
    mContractedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_EXPANDED || (mExpandedChild != null && !dark)) {
    mExpandedWrapper.setDark(dark,fade,delay);
  }
  if (mVisibleType == VISIBLE_TYPE_HEADSUP || (mHeadsUpChild != null && !dark)) {
    mHeadsUpWrapper.setDark(dark,fade,delay);
  }
  if (mSingleLineView != null && (mVisibleType == VISIBLE_TYPE_SINGLELINE || !dark)) {
    mSingleLineView.setDark(dark,fade,delay);
  }
}
Program: 192636
Project: 192636
Buggy source:
public void onNotificationUpdated(NotificationData.Entry entry){
  mStatusBarNotification=entry.notification;
  mBeforeN=entry.targetSdk < Build.VERSION_CODES.N;
  updateSingleLineView();
  applyRemoteInput(entry);
  selectLayout(false,true);
  if (mContractedChild != null) {
    mContractedWrapper.notifyContentUpdated(entry.notification);
    mContractedWrapper.setDark(mDark,false,0);
  }
  if (mExpandedChild != null) {
    mExpandedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpWrapper.notifyContentUpdated(entry.notification);
  }
}

Fixed version (ground truth):
public void onNotificationUpdated(NotificationData.Entry entry){
  mStatusBarNotification=entry.notification;
  mBeforeN=entry.targetSdk < Build.VERSION_CODES.N;
  updateSingleLineView();
  applyRemoteInput(entry);
  selectLayout(false,true);
  if (mContractedChild != null) {
    mContractedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mExpandedChild != null) {
    mExpandedWrapper.notifyContentUpdated(entry.notification);
  }
  if (mHeadsUpChild != null) {
    mHeadsUpWrapper.notifyContentUpdated(entry.notification);
  }
  setDark(mDark,false,0,true);
}
Program: 192637
Project: 192637
Buggy source:
/** 
 * Whether key will, by default, trigger a click on the focused view.
 * @hide
 */
public static final boolean isConfirmKey(int keyCode){
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_SPACE:
    return true;
default :
  return false;
}
}

Fixed version (ground truth):
/** 
 * Whether key will, by default, trigger a click on the focused view.
 * @hide
 */
public static final boolean isConfirmKey(int keyCode){
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
    return true;
default :
  return false;
}
}
Program: 192638
Project: 192638
Buggy source:
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (KeyEvent.isConfirmKey(keyCode)) {
    performClick(mOkButton);
    return true;
  }
 else   if (keyCode == KeyEvent.KEYCODE_DEL) {
    performClick(mDeleteButton);
    return true;
  }
  if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) {
    int number=keyCode - KeyEvent.KEYCODE_0;
    performNumberClick(number);
    return true;
  }
  return super.onKeyDown(keyCode,event);
}

Fixed version (ground truth):
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (KeyEvent.isConfirmKey(keyCode)) {
    performClick(mOkButton);
    return true;
  }
 else   if (keyCode == KeyEvent.KEYCODE_DEL) {
    performClick(mDeleteButton);
    return true;
  }
  if (keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9) {
    int number=keyCode - KeyEvent.KEYCODE_0;
    performNumberClick(number);
    return true;
  }
  if (keyCode >= KeyEvent.KEYCODE_NUMPAD_0 && keyCode <= KeyEvent.KEYCODE_NUMPAD_9) {
    int number=keyCode - KeyEvent.KEYCODE_NUMPAD_0;
    performNumberClick(number);
    return true;
  }
  return super.onKeyDown(keyCode,event);
}
Program: 192640
Project: 192640
Buggy source:
/** 
 * Draw the tick marks.
 */
void drawTickMarks(Canvas canvas){
  if (mTickMark != null) {
    final int count=getMax();
    if (count > 1) {
      final int w=mTickMark.getIntrinsicWidth();
      final int h=mTickMark.getIntrinsicHeight();
      final int halfW=w >= 0 ? w / 2 : 1;
      final int halfH=h >= 0 ? h / 2 : 1;
      mTickMark.setBounds(-halfW,-halfH,halfW,halfH);
      final int spacing=(getWidth() - mPaddingLeft - mPaddingRight) / count;
      final int saveCount=canvas.save();
      canvas.translate(mPaddingLeft,getHeight() / 2);
      for (int i=0; i <= count; i++) {
        mTickMark.draw(canvas);
        canvas.translate(spacing,0);
      }
      canvas.restoreToCount(saveCount);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draw the tick marks.
 */
void drawTickMarks(Canvas canvas){
  if (mTickMark != null) {
    final int count=getMax();
    if (count > 1) {
      final int w=mTickMark.getIntrinsicWidth();
      final int h=mTickMark.getIntrinsicHeight();
      final int halfW=w >= 0 ? w / 2 : 1;
      final int halfH=h >= 0 ? h / 2 : 1;
      mTickMark.setBounds(-halfW,-halfH,halfW,halfH);
      final float spacing=(getWidth() - mPaddingLeft - mPaddingRight) / (float)count;
      final int saveCount=canvas.save();
      canvas.translate(mPaddingLeft,getHeight() / 2);
      for (int i=0; i <= count; i++) {
        mTickMark.draw(canvas);
        canvas.translate(spacing,0);
      }
      canvas.restoreToCount(saveCount);
    }
  }
}
Program: 192641
Project: 192641
Buggy source:
/** 
 * Draw the tick marks.
 */
void drawTickMarks(Canvas canvas){
  if (mTickMark != null) {
    final int count=getMax();
    if (count > 1) {
      final int w=mTickMark.getIntrinsicWidth();
      final int h=mTickMark.getIntrinsicHeight();
      final int halfW=w >= 0 ? w / 2 : 1;
      final int halfH=h >= 0 ? h / 2 : 1;
      mTickMark.setBounds(-halfW,-halfH,halfW,halfH);
      final int spacing=(getWidth() - mPaddingLeft - mPaddingRight) / count;
      final int saveCount=canvas.save();
      canvas.translate(mPaddingLeft,getHeight() / 2);
      for (int i=0; i <= count; i++) {
        mTickMark.draw(canvas);
        canvas.translate(spacing,0);
      }
      canvas.restoreToCount(saveCount);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draw the tick marks.
 */
void drawTickMarks(Canvas canvas){
  if (mTickMark != null) {
    final int count=getMax();
    if (count > 1) {
      final int w=mTickMark.getIntrinsicWidth();
      final int h=mTickMark.getIntrinsicHeight();
      final int halfW=w >= 0 ? w / 2 : 1;
      final int halfH=h >= 0 ? h / 2 : 1;
      mTickMark.setBounds(-halfW,-halfH,halfW,halfH);
      final float spacing=(getWidth() - mPaddingLeft - mPaddingRight) / (float)count;
      final int saveCount=canvas.save();
      canvas.translate(mPaddingLeft,getHeight() / 2);
      for (int i=0; i <= count; i++) {
        mTickMark.draw(canvas);
        canvas.translate(spacing,0);
      }
      canvas.restoreToCount(saveCount);
    }
  }
}
Program: 192642
Project: 192642
Buggy source:
void updateDisplayInfo(Rect bounds){
  mUpdateBoundsAfterRotation=false;
  if (mDisplayContent != null) {
    for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
      mTasks.get(taskNdx).updateDisplayInfo(mDisplayContent);
    }
    if (bounds != null) {
      setBounds(bounds);
    }
 else     if (mFullscreen) {
      setBounds(null);
    }
 else {
      mUpdateBoundsAfterRotation=true;
      mTmpRect2.set(mBounds);
      final int newRotation=mDisplayContent.getDisplayInfo().rotation;
      if (mRotation == newRotation) {
        setBounds(mTmpRect2);
      }
    }
  }
}

Fixed version (ground truth):
void updateDisplayInfo(Rect bounds){
  if (mDisplayContent == null) {
    return;
  }
  for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
    mTasks.get(taskNdx).updateDisplayInfo(mDisplayContent);
  }
  if (bounds != null) {
    setBounds(bounds);
    return;
  }
 else   if (mFullscreen) {
    setBounds(null);
    return;
  }
  mTmpRect2.set(mBounds);
  final int newRotation=mDisplayContent.getDisplayInfo().rotation;
  if (mRotation == newRotation) {
    setBounds(mTmpRect2);
  }
 else {
    mLastUpdateDisplayInfoRotation=newRotation;
    updateBoundsAfterRotation();
  }
}
Program: 192643
Project: 192643
Buggy source:
/** 
 * Updates the bounds after rotating the screen. We can't handle it in  {@link #updateDisplayInfo} because at that point the configuration might not be fully updatedyet.
 */
void updateBoundsAfterRotation(){
  if (!mUpdateBoundsAfterRotation) {
    return;
  }
  mUpdateBoundsAfterRotation=false;
  final int newRotation=getDisplayInfo().rotation;
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    snapDockedStackAfterRotation(mTmpRect2);
  }
  mService.mH.sendMessage(mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2));
}

Fixed version (ground truth):
void updateBoundsAfterRotation(){
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return;
  }
  final int newRotation=getDisplayInfo().rotation;
  if (mRotation == newRotation) {
    return;
  }
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    snapDockedStackAfterRotation(mTmpRect2);
  }
  mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
}
Program: 192644
Project: 192644
Buggy source:
@Override public void setNewConfiguration(Configuration config){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final boolean orientationChanged=mCurConfiguration.orientation != config.orientation;
    mCurConfiguration=new Configuration(config);
    if (mWaitingForConfig) {
      mWaitingForConfig=false;
      mLastFinishedFreezeSource="String_Node_Str";
    }
    if (orientationChanged) {
      updateTaskStackBoundsAfterRotation();
    }
    mWindowPlacerLocked.performSurfacePlacement();
  }
}

Fixed version (ground truth):
@Override public void setNewConfiguration(Configuration config){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    mCurConfiguration=new Configuration(config);
    if (mWaitingForConfig) {
      mWaitingForConfig=false;
      mLastFinishedFreezeSource="String_Node_Str";
    }
    onConfigurationChanged();
    mWindowPlacerLocked.performSurfacePlacement();
  }
}
Program: 192645
Project: 192645
Buggy source:
void updateDisplayInfo(Rect bounds){
  mUpdateBoundsAfterRotation=false;
  if (mDisplayContent != null) {
    for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
      mTasks.get(taskNdx).updateDisplayInfo(mDisplayContent);
    }
    if (bounds != null) {
      setBounds(bounds);
    }
 else     if (mFullscreen) {
      setBounds(null);
    }
 else {
      mUpdateBoundsAfterRotation=true;
      mTmpRect2.set(mBounds);
      final int newRotation=mDisplayContent.getDisplayInfo().rotation;
      if (mRotation == newRotation) {
        setBounds(mTmpRect2);
      }
    }
  }
}

Fixed version (ground truth):
void updateDisplayInfo(Rect bounds){
  if (mDisplayContent == null) {
    return;
  }
  for (int taskNdx=mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
    mTasks.get(taskNdx).updateDisplayInfo(mDisplayContent);
  }
  if (bounds != null) {
    setBounds(bounds);
    return;
  }
 else   if (mFullscreen) {
    setBounds(null);
    return;
  }
  mTmpRect2.set(mBounds);
  final int newRotation=mDisplayContent.getDisplayInfo().rotation;
  if (mRotation == newRotation) {
    setBounds(mTmpRect2);
  }
 else {
    mLastUpdateDisplayInfoRotation=newRotation;
    updateBoundsAfterRotation();
  }
}
Program: 192646
Project: 192646
Buggy source:
/** 
 * Updates the bounds after rotating the screen. We can't handle it in  {@link #updateDisplayInfo} because at that point the configuration might not be fully updatedyet.
 */
void updateBoundsAfterRotation(){
  if (!mUpdateBoundsAfterRotation) {
    return;
  }
  mUpdateBoundsAfterRotation=false;
  final int newRotation=getDisplayInfo().rotation;
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    snapDockedStackAfterRotation(mTmpRect2);
  }
  mService.mH.sendMessage(mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2));
}

Fixed version (ground truth):
void updateBoundsAfterRotation(){
  if (mLastConfigChangedRotation != mLastUpdateDisplayInfoRotation) {
    return;
  }
  final int newRotation=getDisplayInfo().rotation;
  if (mRotation == newRotation) {
    return;
  }
  mDisplayContent.rotateBounds(mRotation,newRotation,mTmpRect2);
  if (mStackId == DOCKED_STACK_ID) {
    snapDockedStackAfterRotation(mTmpRect2);
  }
  mService.mH.obtainMessage(RESIZE_STACK,mStackId,0,mTmpRect2).sendToTarget();
}
Program: 192647
Project: 192647
Buggy source:
@Override public void setNewConfiguration(Configuration config){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    final boolean orientationChanged=mCurConfiguration.orientation != config.orientation;
    mCurConfiguration=new Configuration(config);
    if (mWaitingForConfig) {
      mWaitingForConfig=false;
      mLastFinishedFreezeSource="String_Node_Str";
    }
    if (orientationChanged) {
      updateTaskStackBoundsAfterRotation();
    }
    mWindowPlacerLocked.performSurfacePlacement();
  }
}

Fixed version (ground truth):
@Override public void setNewConfiguration(Configuration config){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
synchronized (mWindowMap) {
    mCurConfiguration=new Configuration(config);
    if (mWaitingForConfig) {
      mWaitingForConfig=false;
      mLastFinishedFreezeSource="String_Node_Str";
    }
    onConfigurationChanged();
    mWindowPlacerLocked.performSurfacePlacement();
  }
}
Program: 192650
Project: 192650
Buggy source:
/** 
 * Stops all recognitions active currently and clears the internal state.
 */
void stopAllRecognitions(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      return;
    }
    if (mCurrentKeyphraseModelHandle != INVALID_VALUE) {
      mRequested=false;
      int status=updateRecognitionLocked(false);
      internalClearKeyphraseStateLocked();
    }
    for (    ModelData model : mGenericModelDataMap.values()) {
      if (model.modelStarted()) {
        int status=stopGenericRecognitionLocked(model,false);
        if (status != STATUS_OK) {
          Slog.w(TAG,"String_Node_Str" + model.getHandle());
        }
        model.clearState();
        model.clearCallback();
      }
    }
    internalClearGlobalStateLocked();
  }
}

Fixed version (ground truth):
/** 
 * Stops all recognitions active currently and clears the internal state.
 */
void stopAllRecognitions(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      return;
    }
    if (mCurrentKeyphraseModelHandle != INVALID_VALUE) {
      mRequested=false;
      int status=updateRecognitionLocked(false);
      internalClearKeyphraseStateLocked();
    }
    for (    ModelData model : mGenericModelDataMap.values()) {
      if (model.isModelStarted()) {
        int status=stopGenericRecognitionLocked(model,false);
        if (status != STATUS_OK) {
          Slog.w(TAG,"String_Node_Str" + model.getHandle());
        }
        model.clearState();
        model.clearCallback();
      }
    }
    internalClearGlobalStateLocked();
  }
}
Program: 192651
Project: 192651
Buggy source:
synchronized boolean isModelLoaded(){
  return (mModelState == MODEL_LOADED || mModelState == MODEL_STARTED) && mSoundModel != null;
}

Fixed version (ground truth):
synchronized boolean isModelLoaded(){
  return (mModelState == MODEL_LOADED || mModelState == MODEL_STARTED);
}
Program: 192652
Project: 192652
Buggy source:
private boolean computeRecognitionRunning(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      mRecognitionRunning=false;
      return mRecognitionRunning;
    }
    if (mKeyphraseListener != null && mKeyphraseStarted && mCurrentKeyphraseModelHandle != INVALID_VALUE && mCurrentSoundModel != null) {
      mRecognitionRunning=true;
      return mRecognitionRunning;
    }
    for (    UUID modelId : mGenericModelDataMap.keySet()) {
      ModelData modelData=mGenericModelDataMap.get(modelId);
      if (modelData.modelStarted()) {
        mRecognitionRunning=true;
        return mRecognitionRunning;
      }
    }
    mRecognitionRunning=false;
  }
  return mRecognitionRunning;
}

Fixed version (ground truth):
private boolean computeRecognitionRunning(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      mRecognitionRunning=false;
      return mRecognitionRunning;
    }
    if (mKeyphraseListener != null && mKeyphraseStarted && mCurrentKeyphraseModelHandle != INVALID_VALUE && mCurrentSoundModel != null) {
      mRecognitionRunning=true;
      return mRecognitionRunning;
    }
    for (    UUID modelId : mGenericModelDataMap.keySet()) {
      ModelData modelData=mGenericModelDataMap.get(modelId);
      if (modelData.isModelStarted()) {
        mRecognitionRunning=true;
        return mRecognitionRunning;
      }
    }
    mRecognitionRunning=false;
  }
  return mRecognitionRunning;
}
Program: 192653
Project: 192653
Buggy source:
synchronized void clearState(){
  mModelState=MODEL_NOTLOADED;
  mSoundModel=null;
  mModelHandle=INVALID_VALUE;
}

Fixed version (ground truth):
synchronized void clearState(){
  mModelState=MODEL_NOTLOADED;
  mModelHandle=INVALID_VALUE;
}
Program: 192654
Project: 192654
Buggy source:
@Override protected boolean disallowSingleClick(MotionEvent event){
  float x=event.getX();
  float y=event.getY();
  NotificationHeaderView header=getNotificationHeader();
  if (header != null) {
    return header.isInTouchRect(x,y);
  }
  return super.disallowSingleClick(event);
}

Fixed version (ground truth):
@Override protected boolean disallowSingleClick(MotionEvent event){
  float x=event.getX();
  float y=event.getY();
  NotificationHeaderView header=getVisibleNotificationHeader();
  if (header != null) {
    return header.isInTouchRect(x,y);
  }
  return super.disallowSingleClick(event);
}
Program: 192657
Project: 192657
Buggy source:
/** 
 * Stops all recognitions active currently and clears the internal state.
 */
void stopAllRecognitions(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      return;
    }
    if (mCurrentKeyphraseModelHandle != INVALID_VALUE) {
      mRequested=false;
      int status=updateRecognitionLocked(false);
      internalClearKeyphraseStateLocked();
    }
    for (    ModelData model : mGenericModelDataMap.values()) {
      if (model.modelStarted()) {
        int status=stopGenericRecognitionLocked(model,false);
        if (status != STATUS_OK) {
          Slog.w(TAG,"String_Node_Str" + model.getHandle());
        }
        model.clearState();
        model.clearCallback();
      }
    }
    internalClearGlobalStateLocked();
  }
}

Fixed version (ground truth):
/** 
 * Stops all recognitions active currently and clears the internal state.
 */
void stopAllRecognitions(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      return;
    }
    if (mCurrentKeyphraseModelHandle != INVALID_VALUE) {
      mRequested=false;
      int status=updateRecognitionLocked(false);
      internalClearKeyphraseStateLocked();
    }
    for (    ModelData model : mGenericModelDataMap.values()) {
      if (model.isModelStarted()) {
        int status=stopGenericRecognitionLocked(model,false);
        if (status != STATUS_OK) {
          Slog.w(TAG,"String_Node_Str" + model.getHandle());
        }
        model.clearState();
        model.clearCallback();
      }
    }
    internalClearGlobalStateLocked();
  }
}
Program: 192658
Project: 192658
Buggy source:
synchronized boolean isModelLoaded(){
  return (mModelState == MODEL_LOADED || mModelState == MODEL_STARTED) && mSoundModel != null;
}

Fixed version (ground truth):
synchronized boolean isModelLoaded(){
  return (mModelState == MODEL_LOADED || mModelState == MODEL_STARTED);
}
Program: 192659
Project: 192659
Buggy source:
private boolean computeRecognitionRunning(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      mRecognitionRunning=false;
      return mRecognitionRunning;
    }
    if (mKeyphraseListener != null && mKeyphraseStarted && mCurrentKeyphraseModelHandle != INVALID_VALUE && mCurrentSoundModel != null) {
      mRecognitionRunning=true;
      return mRecognitionRunning;
    }
    for (    UUID modelId : mGenericModelDataMap.keySet()) {
      ModelData modelData=mGenericModelDataMap.get(modelId);
      if (modelData.modelStarted()) {
        mRecognitionRunning=true;
        return mRecognitionRunning;
      }
    }
    mRecognitionRunning=false;
  }
  return mRecognitionRunning;
}

Fixed version (ground truth):
private boolean computeRecognitionRunning(){
synchronized (mLock) {
    if (mModuleProperties == null || mModule == null) {
      mRecognitionRunning=false;
      return mRecognitionRunning;
    }
    if (mKeyphraseListener != null && mKeyphraseStarted && mCurrentKeyphraseModelHandle != INVALID_VALUE && mCurrentSoundModel != null) {
      mRecognitionRunning=true;
      return mRecognitionRunning;
    }
    for (    UUID modelId : mGenericModelDataMap.keySet()) {
      ModelData modelData=mGenericModelDataMap.get(modelId);
      if (modelData.isModelStarted()) {
        mRecognitionRunning=true;
        return mRecognitionRunning;
      }
    }
    mRecognitionRunning=false;
  }
  return mRecognitionRunning;
}
Program: 192660
Project: 192660
Buggy source:
synchronized void clearState(){
  mModelState=MODEL_NOTLOADED;
  mSoundModel=null;
  mModelHandle=INVALID_VALUE;
}

Fixed version (ground truth):
synchronized void clearState(){
  mModelState=MODEL_NOTLOADED;
  mModelHandle=INVALID_VALUE;
}
Program: 192661
Project: 192661
Buggy source:
@Override protected boolean disallowSingleClick(MotionEvent event){
  float x=event.getX();
  float y=event.getY();
  NotificationHeaderView header=getNotificationHeader();
  if (header != null) {
    return header.isInTouchRect(x,y);
  }
  return super.disallowSingleClick(event);
}

Fixed version (ground truth):
@Override protected boolean disallowSingleClick(MotionEvent event){
  float x=event.getX();
  float y=event.getY();
  NotificationHeaderView header=getVisibleNotificationHeader();
  if (header != null) {
    return header.isInTouchRect(x,y);
  }
  return super.disallowSingleClick(event);
}
Program: 192663
Project: 192663
Buggy source:
private void migrateUserRestrictionsForUser(UserHandle user,ActiveAdmin admin,Set<String> exceptionList){
  final Bundle origRestrictions=mUserManagerInternal.getBaseUserRestrictions(user.getIdentifier());
  final Bundle newBaseRestrictions=new Bundle();
  final Bundle newOwnerRestrictions=new Bundle();
  for (  String key : origRestrictions.keySet()) {
    if (!origRestrictions.getBoolean(key)) {
      continue;
    }
    if (exceptionList != null && exceptionList.contains(key)) {
      newBaseRestrictions.putBoolean(key,true);
    }
 else {
      newOwnerRestrictions.putBoolean(key,true);
    }
  }
  if (VERBOSE_LOG) {
    Log.v(LOG_TAG,"String_Node_Str" + origRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newBaseRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newOwnerRestrictions);
  }
  mUserManagerInternal.setBaseUserRestrictionsByDpmsForMigration(user.getIdentifier(),newBaseRestrictions);
  if (admin != null) {
    admin.ensureUserRestrictions().clear();
    admin.ensureUserRestrictions().putAll(newOwnerRestrictions);
  }
 else {
    Slog.w(LOG_TAG,"String_Node_Str" + user.getIdentifier());
  }
  saveSettingsLocked(user.getIdentifier());
}

Fixed version (ground truth):
private void migrateUserRestrictionsForUser(UserHandle user,ActiveAdmin admin,Set<String> exceptionList,boolean isDeviceOwner){
  final Bundle origRestrictions=mUserManagerInternal.getBaseUserRestrictions(user.getIdentifier());
  final Bundle newBaseRestrictions=new Bundle();
  final Bundle newOwnerRestrictions=new Bundle();
  for (  String key : origRestrictions.keySet()) {
    if (!origRestrictions.getBoolean(key)) {
      continue;
    }
    final boolean canOwnerChange=isDeviceOwner ? UserRestrictionsUtils.canDeviceOwnerChange(key) : UserRestrictionsUtils.canProfileOwnerChange(key,user.getIdentifier());
    if (!canOwnerChange || (exceptionList != null && exceptionList.contains(key))) {
      newBaseRestrictions.putBoolean(key,true);
    }
 else {
      newOwnerRestrictions.putBoolean(key,true);
    }
  }
  if (VERBOSE_LOG) {
    Log.v(LOG_TAG,"String_Node_Str" + origRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newBaseRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newOwnerRestrictions);
  }
  mUserManagerInternal.setBaseUserRestrictionsByDpmsForMigration(user.getIdentifier(),newBaseRestrictions);
  if (admin != null) {
    admin.ensureUserRestrictions().clear();
    admin.ensureUserRestrictions().putAll(newOwnerRestrictions);
  }
 else {
    Slog.w(LOG_TAG,"String_Node_Str" + user.getIdentifier());
  }
  saveSettingsLocked(user.getIdentifier());
}
Program: 192665
Project: 192665
Buggy source:
private void migrateUserRestrictionsForUser(UserHandle user,ActiveAdmin admin,Set<String> exceptionList){
  final Bundle origRestrictions=mUserManagerInternal.getBaseUserRestrictions(user.getIdentifier());
  final Bundle newBaseRestrictions=new Bundle();
  final Bundle newOwnerRestrictions=new Bundle();
  for (  String key : origRestrictions.keySet()) {
    if (!origRestrictions.getBoolean(key)) {
      continue;
    }
    if (exceptionList != null && exceptionList.contains(key)) {
      newBaseRestrictions.putBoolean(key,true);
    }
 else {
      newOwnerRestrictions.putBoolean(key,true);
    }
  }
  if (VERBOSE_LOG) {
    Log.v(LOG_TAG,"String_Node_Str" + origRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newBaseRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newOwnerRestrictions);
  }
  mUserManagerInternal.setBaseUserRestrictionsByDpmsForMigration(user.getIdentifier(),newBaseRestrictions);
  if (admin != null) {
    admin.ensureUserRestrictions().clear();
    admin.ensureUserRestrictions().putAll(newOwnerRestrictions);
  }
 else {
    Slog.w(LOG_TAG,"String_Node_Str" + user.getIdentifier());
  }
  saveSettingsLocked(user.getIdentifier());
}

Fixed version (ground truth):
private void migrateUserRestrictionsForUser(UserHandle user,ActiveAdmin admin,Set<String> exceptionList,boolean isDeviceOwner){
  final Bundle origRestrictions=mUserManagerInternal.getBaseUserRestrictions(user.getIdentifier());
  final Bundle newBaseRestrictions=new Bundle();
  final Bundle newOwnerRestrictions=new Bundle();
  for (  String key : origRestrictions.keySet()) {
    if (!origRestrictions.getBoolean(key)) {
      continue;
    }
    final boolean canOwnerChange=isDeviceOwner ? UserRestrictionsUtils.canDeviceOwnerChange(key) : UserRestrictionsUtils.canProfileOwnerChange(key,user.getIdentifier());
    if (!canOwnerChange || (exceptionList != null && exceptionList.contains(key))) {
      newBaseRestrictions.putBoolean(key,true);
    }
 else {
      newOwnerRestrictions.putBoolean(key,true);
    }
  }
  if (VERBOSE_LOG) {
    Log.v(LOG_TAG,"String_Node_Str" + origRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newBaseRestrictions);
    Log.v(LOG_TAG,"String_Node_Str" + newOwnerRestrictions);
  }
  mUserManagerInternal.setBaseUserRestrictionsByDpmsForMigration(user.getIdentifier(),newBaseRestrictions);
  if (admin != null) {
    admin.ensureUserRestrictions().clear();
    admin.ensureUserRestrictions().putAll(newOwnerRestrictions);
  }
 else {
    Slog.w(LOG_TAG,"String_Node_Str" + user.getIdentifier());
  }
  saveSettingsLocked(user.getIdentifier());
}
Program: 192666
Project: 192666
Buggy source:
@Override public void run(){
  updateRecentsIcon(exists);
}

Fixed version (ground truth):
@Override public void run(){
  mDockedStackExists=exists;
  updateRecentsIcon();
}
Program: 192667
Project: 192667
Buggy source:
private void updateRecentsIcon(boolean dockedStackExists){
  getRecentsButton().setImageResource(dockedStackExists ? R.drawable.ic_sysbar_docked : R.drawable.ic_sysbar_recent);
}

Fixed version (ground truth):
private void updateRecentsIcon(){
  getRecentsButton().setImageDrawable(mDockedStackExists ? mDockedIcon : mRecentIcon);
}
Program: 192668
Project: 192668
Buggy source:
@Override public void onDockedStackExistsChanged(final boolean exists) throws RemoteException {
  mHandler.post(new Runnable(){
    @Override public void run(){
      updateRecentsIcon(exists);
    }
  }
);
}

Fixed version (ground truth):
@Override public void onDockedStackExistsChanged(final boolean exists) throws RemoteException {
  mHandler.post(new Runnable(){
    @Override public void run(){
      mDockedStackExists=exists;
      updateRecentsIcon();
    }
  }
);
}
Program: 192669
Project: 192669
Buggy source:
@Override public void onFinishInflate(){
  mRotatedViews[Surface.ROTATION_0]=mRotatedViews[Surface.ROTATION_180]=findViewById(R.id.rot0);
  mRotatedViews[Surface.ROTATION_90]=findViewById(R.id.rot90);
  mRotatedViews[Surface.ROTATION_270]=mRotatedViews[Surface.ROTATION_90];
  mCurrentView=mRotatedViews[Surface.ROTATION_0];
  for (int i=0; i < mButtonDisatchers.size(); i++) {
    mButtonDisatchers.valueAt(i).setCurrentView(mCurrentView);
  }
  ((NavigationBarInflaterView)findViewById(R.id.navigation_inflater)).setButtonDispatchers(mButtonDisatchers);
  getImeSwitchButton().setOnClickListener(mImeSwitcherClickListener);
  try {
    WindowManagerGlobal.getWindowManagerService().registerDockedStackListener(new Stub(){
      @Override public void onDividerVisibilityChanged(      boolean visible) throws RemoteException {
      }
      @Override public void onDockedStackExistsChanged(      final boolean exists) throws RemoteException {
        mHandler.post(new Runnable(){
          @Override public void run(){
            updateRecentsIcon(exists);
          }
        }
);
      }
    }
);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void onFinishInflate(){
  mRotatedViews[Surface.ROTATION_0]=mRotatedViews[Surface.ROTATION_180]=findViewById(R.id.rot0);
  mRotatedViews[Surface.ROTATION_90]=findViewById(R.id.rot90);
  mRotatedViews[Surface.ROTATION_270]=mRotatedViews[Surface.ROTATION_90];
  mCurrentView=mRotatedViews[Surface.ROTATION_0];
  for (int i=0; i < mButtonDisatchers.size(); i++) {
    mButtonDisatchers.valueAt(i).setCurrentView(mCurrentView);
  }
  ((NavigationBarInflaterView)findViewById(R.id.navigation_inflater)).setButtonDispatchers(mButtonDisatchers);
  getImeSwitchButton().setOnClickListener(mImeSwitcherClickListener);
  try {
    WindowManagerGlobal.getWindowManagerService().registerDockedStackListener(new Stub(){
      @Override public void onDividerVisibilityChanged(      boolean visible) throws RemoteException {
      }
      @Override public void onDockedStackExistsChanged(      final boolean exists) throws RemoteException {
        mHandler.post(new Runnable(){
          @Override public void run(){
            mDockedStackExists=exists;
            updateRecentsIcon();
          }
        }
);
      }
    }
);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}