nus-yam/ex-repair huggingface dataset:
Program: 22856
Project: 22856
Buggy source:
View createUnlockScreenFor(UnlockMode unlockMode){
  mIsPortrait=getResources().getBoolean(R.bool.lockscreen_isPortrait);
  View unlockView=null;
  if (unlockMode == UnlockMode.Pattern) {
    PatternUnlockScreen view=new PatternUnlockScreen(mContext,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback,mUpdateMonitor.getFailedAttempts());
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + unlockMode + "String_Node_Str"+ mEnableFallback);
    view.setEnableFallback(mEnableFallback);
    unlockView=view;
  }
 else   if (unlockMode == UnlockMode.SimPin) {
    unlockView=new SimUnlockScreen(mContext,mUpdateMonitor,mKeyguardScreenCallback,mLockPatternUtils);
  }
 else   if (unlockMode == UnlockMode.Account) {
    try {
      unlockView=new AccountUnlockScreen(mContext,mKeyguardScreenCallback,mLockPatternUtils);
    }
 catch (    IllegalStateException e) {
      Log.i(TAG,"String_Node_Str" + "String_Node_Str");
      unlockView=createUnlockScreenFor(UnlockMode.Pattern);
    }
  }
 else   if (unlockMode == UnlockMode.Password) {
    unlockView=new PasswordUnlockScreen(mContext,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + unlockMode);
  }
  mCurrentUnlockMode=unlockMode;
  return unlockView;
}

Fixed version (ground truth):
View createUnlockScreenFor(UnlockMode unlockMode){
  View unlockView=null;
  if (unlockMode == UnlockMode.Pattern) {
    PatternUnlockScreen view=new PatternUnlockScreen(mContext,mConfiguration,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback,mUpdateMonitor.getFailedAttempts());
    if (DEBUG)     Log.d(TAG,"String_Node_Str" + unlockMode + "String_Node_Str"+ mEnableFallback);
    view.setEnableFallback(mEnableFallback);
    unlockView=view;
  }
 else   if (unlockMode == UnlockMode.SimPin) {
    unlockView=new SimUnlockScreen(mContext,mConfiguration,mUpdateMonitor,mKeyguardScreenCallback,mLockPatternUtils);
  }
 else   if (unlockMode == UnlockMode.Account) {
    try {
      unlockView=new AccountUnlockScreen(mContext,mConfiguration,mKeyguardScreenCallback,mLockPatternUtils);
    }
 catch (    IllegalStateException e) {
      Log.i(TAG,"String_Node_Str" + "String_Node_Str");
      unlockView=createUnlockScreenFor(UnlockMode.Pattern);
    }
  }
 else   if (unlockMode == UnlockMode.Password) {
    unlockView=new PasswordUnlockScreen(mContext,mConfiguration,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + unlockMode);
  }
  mCurrentUnlockMode=unlockMode;
  return unlockView;
}
Program: 22857
Project: 22857
Buggy source:
@Override protected void dispatchDraw(Canvas canvas){
  final int orientation=getResources().getConfiguration().orientation;
  if (mIsPortrait && Configuration.ORIENTATION_PORTRAIT != orientation || getResources().getBoolean(R.bool.lockscreen_isPortrait) != mIsPortrait) {
    postInvalidate();
    ViewGroup view=(ViewGroup)(mMode == Mode.LockScreen ? mLockScreen : mUnlockScreen);
    if (view != null && view.getChildAt(0) != null) {
      Drawable background=view.getChildAt(0).getBackground();
      if (background != null) {
        background.draw(canvas);
      }
    }
    return;
  }
  super.dispatchDraw(canvas);
}

Fixed version (ground truth):
@Override protected void dispatchDraw(Canvas canvas){
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + SystemClock.elapsedRealtime());
  super.dispatchDraw(canvas);
}
Program: 22858
Project: 22858
Buggy source:
public void recreateMe(){
  recreateScreens();
}

Fixed version (ground truth):
public void recreateMe(Configuration config){
  mConfiguration=config;
  recreateScreens();
}
Program: 22859
Project: 22859
Buggy source:
/** 
 * Send ar.userObj if its a message, which is should be back to originator.
 * @param dp is the DisconnectParams.
 */
private void notifyDisconnectCompleted(DisconnectParams dp){
  if (DBG)   log("String_Node_Str");
  Message msg=dp.onCompletedMsg;
  log(String.format("String_Node_Str",msg.what,((msg.obj instanceof String) ? (String)msg.obj : "String_Node_Str")));
  AsyncResult.forMessage(msg);
  msg.sendToTarget();
  clearSettings();
}

Fixed version (ground truth):
/** 
 * Send ar.userObj if its a message, which is should be back to originator.
 * @param dp is the DisconnectParams.
 */
private void notifyDisconnectCompleted(DisconnectParams dp){
  if (DBG)   log("String_Node_Str");
  if (dp.onCompletedMsg != null) {
    Message msg=dp.onCompletedMsg;
    log(String.format("String_Node_Str",msg.what,((msg.obj instanceof String) ? (String)msg.obj : "String_Node_Str")));
    AsyncResult.forMessage(msg);
    msg.sendToTarget();
  }
  if (dp.lockObj != null) {
synchronized (dp.lockObj) {
      dp.lockObj.notify();
    }
  }
  clearSettings();
}
Program: 22860
Project: 22860
Buggy source:
public DisconnectParams(Message onCompletedMsg){
  this.onCompletedMsg=onCompletedMsg;
}

Fixed version (ground truth):
public DisconnectParams(ResetSynchronouslyLock lockObj){
  this.lockObj=lockObj;
}
Program: 22861
Project: 22861
Buggy source:
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying DataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : dataConnectionList) {
    if (conn != null) {
      if (tearDown) {
        if (DBG)         log("String_Node_Str");
        conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
      }
 else {
        if (DBG)         log("String_Node_Str");
        conn.reset(obtainMessage(EVENT_RESET_DONE,reason));
      }
      notificationDeferred=true;
    }
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}

Fixed version (ground truth):
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying DataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : dataConnectionList) {
    if (conn != null) {
      if (tearDown) {
        if (DBG)         log("String_Node_Str");
        conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
        notificationDeferred=true;
      }
 else {
        if (DBG)         log("String_Node_Str");
        conn.resetSynchronously();
        notificationDeferred=false;
      }
    }
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}
Program: 22862
Project: 22862
Buggy source:
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying GsmDataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : pdpList) {
    if (tearDown) {
      if (DBG)       log("String_Node_Str");
      conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
    }
 else {
      if (DBG)       log("String_Node_Str");
      conn.reset(obtainMessage(EVENT_RESET_DONE,reason));
    }
    notificationDeferred=true;
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}

Fixed version (ground truth):
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying GsmDataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : pdpList) {
    if (tearDown) {
      if (DBG)       log("String_Node_Str");
      conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
      notificationDeferred=true;
    }
 else {
      if (DBG)       log("String_Node_Str");
      conn.resetSynchronously();
      notificationDeferred=false;
    }
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}
Program: 22863
Project: 22863
Buggy source:
public boolean validateMemoryResult(int startPid,int startMemory,Writer output,int limit) throws Exception {
  Thread.sleep(10000);
  mEndPid=getMediaserverPid();
  int memDiff=mEndMemory - startMemory;
  if (memDiff < 0)   memDiff=0;
 else   output.write("String_Node_Str" + memDiff);
  output.write("String_Node_Str");
  if (startPid != mEndPid) {
    output.write("String_Node_Str");
    return false;
  }
  if (memDiff > limit)   return false;
  return true;
}

Fixed version (ground truth):
public boolean validateMemoryResult(int startPid,int startMemory,Writer output,int limit) throws Exception {
  Thread.sleep(10000);
  mEndPid=getMediaserverPid();
  int memDiff=mEndMemory - startMemory;
  if (memDiff < 0) {
    memDiff=0;
  }
  output.write("String_Node_Str" + memDiff);
  output.write("String_Node_Str");
  if (startPid != mEndPid) {
    output.write("String_Node_Str");
    return false;
  }
  if (memDiff > limit)   return false;
  return true;
}
Program: 22864
Project: 22864
Buggy source:
/** 
 * Send ar.userObj if its a message, which is should be back to originator.
 * @param dp is the DisconnectParams.
 */
private void notifyDisconnectCompleted(DisconnectParams dp){
  if (DBG)   log("String_Node_Str");
  Message msg=dp.onCompletedMsg;
  log(String.format("String_Node_Str",msg.what,((msg.obj instanceof String) ? (String)msg.obj : "String_Node_Str")));
  AsyncResult.forMessage(msg);
  msg.sendToTarget();
  clearSettings();
}

Fixed version (ground truth):
/** 
 * Send ar.userObj if its a message, which is should be back to originator.
 * @param dp is the DisconnectParams.
 */
private void notifyDisconnectCompleted(DisconnectParams dp){
  if (DBG)   log("String_Node_Str");
  if (dp.onCompletedMsg != null) {
    Message msg=dp.onCompletedMsg;
    log(String.format("String_Node_Str",msg.what,((msg.obj instanceof String) ? (String)msg.obj : "String_Node_Str")));
    AsyncResult.forMessage(msg);
    msg.sendToTarget();
  }
  if (dp.lockObj != null) {
synchronized (dp.lockObj) {
      dp.lockObj.notify();
    }
  }
  clearSettings();
}
Program: 22865
Project: 22865
Buggy source:
public DisconnectParams(Message onCompletedMsg){
  this.onCompletedMsg=onCompletedMsg;
}

Fixed version (ground truth):
public DisconnectParams(ResetSynchronouslyLock lockObj){
  this.lockObj=lockObj;
}
Program: 22866
Project: 22866
Buggy source:
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying DataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : dataConnectionList) {
    if (conn != null) {
      if (tearDown) {
        if (DBG)         log("String_Node_Str");
        conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
      }
 else {
        if (DBG)         log("String_Node_Str");
        conn.reset(obtainMessage(EVENT_RESET_DONE,reason));
      }
      notificationDeferred=true;
    }
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}

Fixed version (ground truth):
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying DataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : dataConnectionList) {
    if (conn != null) {
      if (tearDown) {
        if (DBG)         log("String_Node_Str");
        conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
        notificationDeferred=true;
      }
 else {
        if (DBG)         log("String_Node_Str");
        conn.resetSynchronously();
        notificationDeferred=false;
      }
    }
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}
Program: 22867
Project: 22867
Buggy source:
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying GsmDataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : pdpList) {
    if (tearDown) {
      if (DBG)       log("String_Node_Str");
      conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
    }
 else {
      if (DBG)       log("String_Node_Str");
      conn.reset(obtainMessage(EVENT_RESET_DONE,reason));
    }
    notificationDeferred=true;
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}

Fixed version (ground truth):
/** 
 * If tearDown is true, this only tears down a CONNECTED session. Presently, there is no mechanism for abandoning an INITING/CONNECTING session, but would likely involve cancelling pending async requests or setting a flag or new state to ignore them when they came in
 * @param tearDown true if the underlying GsmDataConnection should bedisconnected.
 * @param reason reason for the clean up.
 */
private void cleanUpConnection(boolean tearDown,String reason){
  if (DBG)   log("String_Node_Str" + reason);
  if (mReconnectIntent != null) {
    AlarmManager am=(AlarmManager)phone.getContext().getSystemService(Context.ALARM_SERVICE);
    am.cancel(mReconnectIntent);
    mReconnectIntent=null;
  }
  setState(State.DISCONNECTING);
  boolean notificationDeferred=false;
  for (  DataConnection conn : pdpList) {
    if (tearDown) {
      if (DBG)       log("String_Node_Str");
      conn.disconnect(obtainMessage(EVENT_DISCONNECT_DONE,reason));
      notificationDeferred=true;
    }
 else {
      if (DBG)       log("String_Node_Str");
      conn.resetSynchronously();
      notificationDeferred=false;
    }
  }
  stopNetStatPoll();
  if (!notificationDeferred) {
    if (DBG)     log("String_Node_Str");
    gotoIdleAndNotifyDataConnection(reason);
  }
}
Program: 22868
Project: 22868
Buggy source:
public int compareTo(Configuration that){
  int n;
  float a=this.fontScale;
  float b=that.fontScale;
  if (a < b)   return -1;
  if (a > b)   return 1;
  n=this.mcc - that.mcc;
  if (n != 0)   return n;
  n=this.mnc - that.mnc;
  if (n != 0)   return n;
  n=this.locale.getLanguage().compareTo(that.locale.getLanguage());
  if (n != 0)   return n;
  n=this.locale.getCountry().compareTo(that.locale.getCountry());
  if (n != 0)   return n;
  n=this.locale.getVariant().compareTo(that.locale.getVariant());
  if (n != 0)   return n;
  n=this.touchscreen - that.touchscreen;
  if (n != 0)   return n;
  n=this.keyboard - that.keyboard;
  if (n != 0)   return n;
  n=this.keyboardHidden - that.keyboardHidden;
  if (n != 0)   return n;
  n=this.hardKeyboardHidden - that.hardKeyboardHidden;
  if (n != 0)   return n;
  n=this.navigation - that.navigation;
  if (n != 0)   return n;
  n=this.navigationHidden - that.navigationHidden;
  if (n != 0)   return n;
  n=this.orientation - that.orientation;
  if (n != 0)   return n;
  n=this.screenLayout - that.screenLayout;
  if (n != 0)   return n;
  n=this.uiMode - that.uiMode;
  return n;
}

Fixed version (ground truth):
public int compareTo(Configuration that){
  int n;
  float a=this.fontScale;
  float b=that.fontScale;
  if (a < b)   return -1;
  if (a > b)   return 1;
  n=this.mcc - that.mcc;
  if (n != 0)   return n;
  n=this.mnc - that.mnc;
  if (n != 0)   return n;
  if (this.locale == null) {
    if (that.locale != null)     return 1;
  }
 else   if (that.locale == null) {
    return -1;
  }
 else {
    n=this.locale.getLanguage().compareTo(that.locale.getLanguage());
    if (n != 0)     return n;
    n=this.locale.getCountry().compareTo(that.locale.getCountry());
    if (n != 0)     return n;
    n=this.locale.getVariant().compareTo(that.locale.getVariant());
    if (n != 0)     return n;
  }
  n=this.touchscreen - that.touchscreen;
  if (n != 0)   return n;
  n=this.keyboard - that.keyboard;
  if (n != 0)   return n;
  n=this.keyboardHidden - that.keyboardHidden;
  if (n != 0)   return n;
  n=this.hardKeyboardHidden - that.hardKeyboardHidden;
  if (n != 0)   return n;
  n=this.navigation - that.navigation;
  if (n != 0)   return n;
  n=this.navigationHidden - that.navigationHidden;
  if (n != 0)   return n;
  n=this.orientation - that.orientation;
  if (n != 0)   return n;
  n=this.screenLayout - that.screenLayout;
  if (n != 0)   return n;
  n=this.uiMode - that.uiMode;
  return n;
}
Program: 22869
Project: 22869
Buggy source:
public int hashCode(){
  return ((int)this.fontScale) + this.mcc + this.mnc+ this.locale.hashCode()+ this.touchscreen+ this.keyboard+ this.keyboardHidden+ this.hardKeyboardHidden+ this.navigation+ this.navigationHidden+ this.orientation+ this.screenLayout+ this.uiMode;
}

Fixed version (ground truth):
public int hashCode(){
  return ((int)this.fontScale) + this.mcc + this.mnc+ (this.locale != null ? this.locale.hashCode() : 0)+ this.touchscreen+ this.keyboard+ this.keyboardHidden+ this.hardKeyboardHidden+ this.navigation+ this.navigationHidden+ this.orientation+ this.screenLayout+ this.uiMode;
}
Program: 22870
Project: 22870
Buggy source:
public boolean validateMemoryResult(int startPid,int startMemory,Writer output,int limit) throws Exception {
  Thread.sleep(10000);
  mEndPid=getMediaserverPid();
  int memDiff=mEndMemory - startMemory;
  if (memDiff < 0)   memDiff=0;
 else   output.write("String_Node_Str" + memDiff);
  output.write("String_Node_Str");
  if (startPid != mEndPid) {
    output.write("String_Node_Str");
    return false;
  }
  if (memDiff > limit)   return false;
  return true;
}

Fixed version (ground truth):
public boolean validateMemoryResult(int startPid,int startMemory,Writer output,int limit) throws Exception {
  Thread.sleep(10000);
  mEndPid=getMediaserverPid();
  int memDiff=mEndMemory - startMemory;
  if (memDiff < 0) {
    memDiff=0;
  }
  output.write("String_Node_Str" + memDiff);
  output.write("String_Node_Str");
  if (startPid != mEndPid) {
    output.write("String_Node_Str");
    return false;
  }
  if (memDiff > limit)   return false;
  return true;
}
Program: 22873
Project: 22873
Buggy source:
public final ActivityRecord performResumeActivity(IBinder token,boolean clearHide){
  ActivityRecord r=mActivities.get(token);
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.activity.mFinished);
  if (r != null && !r.activity.mFinished) {
    if (clearHide) {
      r.hideForNow=false;
      r.activity.mStartedActivity=false;
    }
    try {
      if (r.pendingIntents != null) {
        deliverNewIntents(r,r.pendingIntents);
        r.pendingIntents=null;
      }
      if (r.pendingResults != null) {
        deliverResults(r,r.pendingResults);
        r.pendingResults=null;
      }
      r.activity.performResume();
      EventLog.writeEvent(LOG_ON_RESUME_CALLED,r.activity.getComponentName().getClassName());
      r.paused=false;
      r.stopped=false;
      if (r.activity.mStartedActivity) {
        r.hideForNow=true;
      }
      r.state=null;
    }
 catch (    Exception e) {
      if (!mInstrumentation.onException(r.activity,e)) {
        throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
      }
    }
  }
  return r;
}

Fixed version (ground truth):
public final ActivityRecord performResumeActivity(IBinder token,boolean clearHide){
  ActivityRecord r=mActivities.get(token);
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.activity.mFinished);
  if (r != null && !r.activity.mFinished) {
    if (clearHide) {
      r.hideForNow=false;
      r.activity.mStartedActivity=false;
    }
    try {
      if (r.pendingIntents != null) {
        deliverNewIntents(r,r.pendingIntents);
        r.pendingIntents=null;
      }
      if (r.pendingResults != null) {
        deliverResults(r,r.pendingResults);
        r.pendingResults=null;
      }
      r.activity.performResume();
      EventLog.writeEvent(LOG_ON_RESUME_CALLED,r.activity.getComponentName().getClassName());
      r.paused=false;
      r.stopped=false;
      r.state=null;
    }
 catch (    Exception e) {
      if (!mInstrumentation.onException(r.activity,e)) {
        throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
      }
    }
  }
  return r;
}
Program: 22874
Project: 22874
Buggy source:
final void handleProfilerControl(boolean start,ProfilerControlData pcd){
  if (start) {
    try {
      Debug.startMethodTracing(pcd.path,pcd.fd.getFileDescriptor(),8 * 1024 * 1024,0);
    }
 catch (    RuntimeException e) {
      Log.w(TAG,"String_Node_Str" + pcd.path + "String_Node_Str");
    }
 finally {
      try {
        pcd.fd.close();
      }
 catch (      IOException e) {
        Log.w(TAG,"String_Node_Str",e);
      }
    }
  }
 else {
    Debug.stopMethodTracing();
  }
}

Fixed version (ground truth):
final void handleProfilerControl(boolean start,ProfilerControlData pcd){
  if (start) {
    try {
      Debug.startMethodTracing(pcd.path,pcd.fd.getFileDescriptor(),8 * 1024 * 1024,0);
    }
 catch (    RuntimeException e) {
      Slog.w(TAG,"String_Node_Str" + pcd.path + "String_Node_Str");
    }
 finally {
      try {
        pcd.fd.close();
      }
 catch (      IOException e) {
        Slog.w(TAG,"String_Node_Str",e);
      }
    }
  }
 else {
    Debug.stopMethodTracing();
  }
}
Program: 22875
Project: 22875
Buggy source:
public void setSchedulingGroup(int group){
  try {
    Process.setProcessGroup(Process.myPid(),group);
  }
 catch (  Exception e) {
    Log.w(TAG,"String_Node_Str" + group,e);
  }
}

Fixed version (ground truth):
public void setSchedulingGroup(int group){
  try {
    Process.setProcessGroup(Process.myPid(),group);
  }
 catch (  Exception e) {
    Slog.w(TAG,"String_Node_Str" + group,e);
  }
}
Program: 22876
Project: 22876
Buggy source:
public void removeContextRegistrations(Context context,String who,String what){
  HashMap<BroadcastReceiver,ReceiverDispatcher> rmap=mReceivers.remove(context);
  if (rmap != null) {
    Iterator<ReceiverDispatcher> it=rmap.values().iterator();
    while (it.hasNext()) {
      ReceiverDispatcher rd=it.next();
      IntentReceiverLeaked leak=new IntentReceiverLeaked(what + "String_Node_Str" + who+ "String_Node_Str"+ rd.getIntentReceiver()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      leak.setStackTrace(rd.getLocation().getStackTrace());
      Log.e(TAG,leak.getMessage(),leak);
      try {
        ActivityManagerNative.getDefault().unregisterReceiver(rd.getIIntentReceiver());
      }
 catch (      RemoteException e) {
      }
    }
  }
  mUnregisteredReceivers.remove(context);
  HashMap<ServiceConnection,ServiceDispatcher> smap=mServices.remove(context);
  if (smap != null) {
    Iterator<ServiceDispatcher> it=smap.values().iterator();
    while (it.hasNext()) {
      ServiceDispatcher sd=it.next();
      ServiceConnectionLeaked leak=new ServiceConnectionLeaked(what + "String_Node_Str" + who+ "String_Node_Str"+ sd.getServiceConnection()+ "String_Node_Str");
      leak.setStackTrace(sd.getLocation().getStackTrace());
      Log.e(TAG,leak.getMessage(),leak);
      try {
        ActivityManagerNative.getDefault().unbindService(sd.getIServiceConnection());
      }
 catch (      RemoteException e) {
      }
      sd.doForget();
    }
  }
  mUnboundServices.remove(context);
}

Fixed version (ground truth):
public void removeContextRegistrations(Context context,String who,String what){
  HashMap<BroadcastReceiver,ReceiverDispatcher> rmap=mReceivers.remove(context);
  if (rmap != null) {
    Iterator<ReceiverDispatcher> it=rmap.values().iterator();
    while (it.hasNext()) {
      ReceiverDispatcher rd=it.next();
      IntentReceiverLeaked leak=new IntentReceiverLeaked(what + "String_Node_Str" + who+ "String_Node_Str"+ rd.getIntentReceiver()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      leak.setStackTrace(rd.getLocation().getStackTrace());
      Slog.e(TAG,leak.getMessage(),leak);
      try {
        ActivityManagerNative.getDefault().unregisterReceiver(rd.getIIntentReceiver());
      }
 catch (      RemoteException e) {
      }
    }
  }
  mUnregisteredReceivers.remove(context);
  HashMap<ServiceConnection,ServiceDispatcher> smap=mServices.remove(context);
  if (smap != null) {
    Iterator<ServiceDispatcher> it=smap.values().iterator();
    while (it.hasNext()) {
      ServiceDispatcher sd=it.next();
      ServiceConnectionLeaked leak=new ServiceConnectionLeaked(what + "String_Node_Str" + who+ "String_Node_Str"+ sd.getServiceConnection()+ "String_Node_Str");
      leak.setStackTrace(sd.getLocation().getStackTrace());
      Slog.e(TAG,leak.getMessage(),leak);
      try {
        ActivityManagerNative.getDefault().unbindService(sd.getIServiceConnection());
      }
 catch (      RemoteException e) {
      }
      sd.doForget();
    }
  }
  mUnboundServices.remove(context);
}
Program: 22879
Project: 22879
Buggy source:
private final void handleDestroyBackupAgent(CreateBackupAgentData data){
  if (DEBUG_BACKUP)   Log.v(TAG,"String_Node_Str" + data);
  PackageInfo packageInfo=getPackageInfoNoCheck(data.appInfo);
  String packageName=packageInfo.mPackageName;
  BackupAgent agent=mBackupAgents.get(packageName);
  if (agent != null) {
    try {
      agent.onDestroy();
    }
 catch (    Exception e) {
      Log.w(TAG,"String_Node_Str" + data.appInfo);
      e.printStackTrace();
    }
    mBackupAgents.remove(packageName);
  }
 else {
    Log.w(TAG,"String_Node_Str" + data);
  }
}

Fixed version (ground truth):
private final void handleDestroyBackupAgent(CreateBackupAgentData data){
  if (DEBUG_BACKUP)   Log.v(TAG,"String_Node_Str" + data);
  PackageInfo packageInfo=getPackageInfoNoCheck(data.appInfo);
  String packageName=packageInfo.mPackageName;
  BackupAgent agent=mBackupAgents.get(packageName);
  if (agent != null) {
    try {
      agent.onDestroy();
    }
 catch (    Exception e) {
      Slog.w(TAG,"String_Node_Str" + data.appInfo);
      e.printStackTrace();
    }
    mBackupAgents.remove(packageName);
  }
 else {
    Slog.w(TAG,"String_Node_Str" + data);
  }
}
Program: 22880
Project: 22880
Buggy source:
private final IContentProvider getProvider(Context context,String name){
synchronized (mProviderMap) {
    final ProviderRecord pr=mProviderMap.get(name);
    if (pr != null) {
      return pr.mProvider;
    }
  }
  IActivityManager.ContentProviderHolder holder=null;
  try {
    holder=ActivityManagerNative.getDefault().getContentProvider(getApplicationThread(),name);
  }
 catch (  RemoteException ex) {
  }
  if (holder == null) {
    Log.e(TAG,"String_Node_Str" + name);
    return null;
  }
  if (holder.permissionFailure != null) {
    throw new SecurityException("String_Node_Str" + holder.permissionFailure + "String_Node_Str"+ name);
  }
  IContentProvider prov=installProvider(context,holder.provider,holder.info,true);
  if (holder.noReleaseNeeded || holder.provider == null) {
synchronized (mProviderMap) {
      mProviderRefCountMap.put(prov.asBinder(),new ProviderRefCount(10000));
    }
  }
  return prov;
}

Fixed version (ground truth):
private final IContentProvider getProvider(Context context,String name){
synchronized (mProviderMap) {
    final ProviderRecord pr=mProviderMap.get(name);
    if (pr != null) {
      return pr.mProvider;
    }
  }
  IActivityManager.ContentProviderHolder holder=null;
  try {
    holder=ActivityManagerNative.getDefault().getContentProvider(getApplicationThread(),name);
  }
 catch (  RemoteException ex) {
  }
  if (holder == null) {
    Slog.e(TAG,"String_Node_Str" + name);
    return null;
  }
  if (holder.permissionFailure != null) {
    throw new SecurityException("String_Node_Str" + holder.permissionFailure + "String_Node_Str"+ name);
  }
  IContentProvider prov=installProvider(context,holder.provider,holder.info,true);
  if (holder.noReleaseNeeded || holder.provider == null) {
synchronized (mProviderMap) {
      mProviderRefCountMap.put(prov.asBinder(),new ProviderRefCount(10000));
    }
  }
  return prov;
}
Program: 22881
Project: 22881
Buggy source:
private final void performStopActivityInner(ActivityRecord r,StopInfo info,boolean keepShown){
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  if (r != null) {
    if (!keepShown && r.stopped) {
      if (r.activity.mFinished) {
        return;
      }
      RuntimeException e=new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString());
      Log.e(TAG,e.getMessage(),e);
    }
    if (info != null) {
      try {
        info.description=r.activity.onCreateDescription();
      }
 catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
    }
    if (!keepShown) {
      try {
        r.activity.performStop();
      }
 catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
      r.stopped=true;
    }
    r.paused=true;
  }
}

Fixed version (ground truth):
private final void performStopActivityInner(ActivityRecord r,StopInfo info,boolean keepShown){
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  if (r != null) {
    if (!keepShown && r.stopped) {
      if (r.activity.mFinished) {
        return;
      }
      RuntimeException e=new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString());
      Slog.e(TAG,e.getMessage(),e);
    }
    if (info != null) {
      try {
        info.description=r.activity.onCreateDescription();
      }
 catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
    }
    if (!keepShown) {
      try {
        r.activity.performStop();
      }
 catch (      Exception e) {
        if (!mInstrumentation.onException(r.activity,e)) {
          throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
        }
      }
      r.stopped=true;
    }
    r.paused=true;
  }
}
Program: 22882
Project: 22882
Buggy source:
private void warn(String methodName){
  if (warned) {
    return;
  }
  warned=true;
  Thread.currentThread().setContextClassLoader(getParent());
  Log.w(TAG,"String_Node_Str" + methodName + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
private void warn(String methodName){
  if (warned) {
    return;
  }
  warned=true;
  Thread.currentThread().setContextClassLoader(getParent());
  Slog.w(TAG,"String_Node_Str" + methodName + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 22883
Project: 22883
Buggy source:
final Bundle performPauseActivity(ActivityRecord r,boolean finished,boolean saveState){
  if (r.paused) {
    if (r.activity.mFinished) {
      return null;
    }
    RuntimeException e=new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString());
    Log.e(TAG,e.getMessage(),e);
  }
  Bundle state=null;
  if (finished) {
    r.activity.mFinished=true;
  }
  try {
    if (!r.activity.mFinished && saveState) {
      state=new Bundle();
      mInstrumentation.callActivityOnSaveInstanceState(r.activity,state);
      r.state=state;
    }
    r.activity.mCalled=false;
    mInstrumentation.callActivityOnPause(r.activity);
    EventLog.writeEvent(LOG_ON_PAUSE_CALLED,r.activity.getComponentName().getClassName());
    if (!r.activity.mCalled) {
      throw new SuperNotCalledException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str");
    }
  }
 catch (  SuperNotCalledException e) {
    throw e;
  }
catch (  Exception e) {
    if (!mInstrumentation.onException(r.activity,e)) {
      throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
    }
  }
  r.paused=true;
  return state;
}

Fixed version (ground truth):
final Bundle performPauseActivity(ActivityRecord r,boolean finished,boolean saveState){
  if (r.paused) {
    if (r.activity.mFinished) {
      return null;
    }
    RuntimeException e=new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString());
    Slog.e(TAG,e.getMessage(),e);
  }
  Bundle state=null;
  if (finished) {
    r.activity.mFinished=true;
  }
  try {
    if (!r.activity.mFinished && saveState) {
      state=new Bundle();
      mInstrumentation.callActivityOnSaveInstanceState(r.activity,state);
      r.state=state;
    }
    r.activity.mCalled=false;
    mInstrumentation.callActivityOnPause(r.activity);
    EventLog.writeEvent(LOG_ON_PAUSE_CALLED,r.activity.getComponentName().getClassName());
    if (!r.activity.mCalled) {
      throw new SuperNotCalledException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str");
    }
  }
 catch (  SuperNotCalledException e) {
    throw e;
  }
catch (  Exception e) {
    if (!mInstrumentation.onException(r.activity,e)) {
      throw new RuntimeException("String_Node_Str" + r.intent.getComponent().toShortString() + "String_Node_Str"+ e.toString(),e);
    }
  }
  r.paused=true;
  return state;
}
Program: 22884
Project: 22884
Buggy source:
/** 
 * The main function called when started through the zygote process. This could be unified with main(), if the native code in finishInit() were rationalized with Zygote startup.<p> Current recognized args: <ul> <li> --nice-name=<i>nice name to appear in ps</i> <li> <code> [--] &lt;start class name&gt;  &lt;args&gt; </ul>
 * @param argv arg strings
 */
public static final void zygoteInit(String[] argv) throws ZygoteInit.MethodAndArgsCaller {
  System.setOut(new AndroidPrintStream(Log.INFO,"String_Node_Str"));
  System.setErr(new AndroidPrintStream(Log.WARN,"String_Node_Str"));
  commonInit();
  zygoteInitNative();
  int curArg=0;
  for (; curArg < argv.length; curArg++) {
    String arg=argv[curArg];
    if (arg.equals("String_Node_Str")) {
      curArg++;
      break;
    }
 else     if (!arg.startsWith("String_Node_Str")) {
      break;
    }
 else     if (arg.startsWith("String_Node_Str")) {
      String niceName=arg.substring(arg.indexOf('=') + 1);
      Process.setArgV0(niceName);
    }
  }
  if (curArg == argv.length) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  String startClass=argv[curArg++];
  String[] startArgs=new String[argv.length - curArg];
  System.arraycopy(argv,curArg,startArgs,0,startArgs.length);
  invokeStaticMain(startClass,startArgs);
}

Fixed version (ground truth):
/** 
 * The main function called when started through the zygote process. This could be unified with main(), if the native code in finishInit() were rationalized with Zygote startup.<p> Current recognized args: <ul> <li> --nice-name=<i>nice name to appear in ps</i> <li> <code> [--] &lt;start class name&gt;  &lt;args&gt; </ul>
 * @param argv arg strings
 */
public static final void zygoteInit(String[] argv) throws ZygoteInit.MethodAndArgsCaller {
  System.setOut(new AndroidPrintStream(Log.INFO,"String_Node_Str"));
  System.setErr(new AndroidPrintStream(Log.WARN,"String_Node_Str"));
  commonInit();
  zygoteInitNative();
  int curArg=0;
  for (; curArg < argv.length; curArg++) {
    String arg=argv[curArg];
    if (arg.equals("String_Node_Str")) {
      curArg++;
      break;
    }
 else     if (!arg.startsWith("String_Node_Str")) {
      break;
    }
 else     if (arg.startsWith("String_Node_Str")) {
      String niceName=arg.substring(arg.indexOf('=') + 1);
      Process.setArgV0(niceName);
    }
  }
  if (curArg == argv.length) {
    Slog.e(TAG,"String_Node_Str");
    return;
  }
  String startClass=argv[curArg++];
  String[] startArgs=new String[argv.length - curArg];
  System.arraycopy(argv,curArg,startArgs,0,startArgs.length);
  invokeStaticMain(startClass,startArgs);
}
Program: 22885
Project: 22885
Buggy source:
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Log.e(TAG,"String_Node_Str",t2);
  }
}

Fixed version (ground truth):
/** 
 * Report a serious error in the current process.  May or may not cause the process to terminate (depends on system settings).
 * @param tag to record with the error
 * @param t exception describing the error site and conditions
 */
public static void wtf(String tag,Throwable t){
  try {
    if (ActivityManagerNative.getDefault().handleApplicationWtf(mApplicationObject,tag,new ApplicationErrorReport.CrashInfo(t))) {
      Process.killProcess(Process.myPid());
      System.exit(10);
    }
  }
 catch (  Throwable t2) {
    Slog.e(TAG,"String_Node_Str",t2);
  }
}
Program: 22886
Project: 22886
Buggy source:
public static final void main(String[] argv){
  commonInit();
  finishInit();
  if (Config.LOGV)   Log.d(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public static final void main(String[] argv){
  commonInit();
  finishInit();
  if (Config.LOGV)   Slog.d(TAG,"String_Node_Str");
}
Program: 22887
Project: 22887
Buggy source:
private static final void commonInit(){
  if (Config.LOGV)   Log.d(TAG,"String_Node_Str");
  Thread.setDefaultUncaughtExceptionHandler(new UncaughtHandler());
  int hasQwerty=getQwertyKeyboard();
  if (Config.LOGV)   Log.d(TAG,"String_Node_Str" + hasQwerty);
  if (hasQwerty == 1) {
    System.setProperty("String_Node_Str","String_Node_Str");
  }
  TimezoneGetter.setInstance(new TimezoneGetter(){
    @Override public String getId(){
      return SystemProperties.get("String_Node_Str");
    }
  }
);
  TimeZone.setDefault(null);
  LogManager.getLogManager().reset();
  new AndroidConfig();
  String userAgent=getDefaultUserAgent();
  System.setProperty("String_Node_Str",userAgent);
  String trace=SystemProperties.get("String_Node_Str");
  if (trace.equals("String_Node_Str")) {
    Log.i(TAG,"String_Node_Str");
    Debug.enableEmulatorTraceOutput();
  }
  initialized=true;
}

Fixed version (ground truth):
private static final void commonInit(){
  if (Config.LOGV)   Slog.d(TAG,"String_Node_Str");
  Thread.setDefaultUncaughtExceptionHandler(new UncaughtHandler());
  int hasQwerty=getQwertyKeyboard();
  if (Config.LOGV)   Slog.d(TAG,"String_Node_Str" + hasQwerty);
  if (hasQwerty == 1) {
    System.setProperty("String_Node_Str","String_Node_Str");
  }
  TimezoneGetter.setInstance(new TimezoneGetter(){
    @Override public String getId(){
      return SystemProperties.get("String_Node_Str");
    }
  }
);
  TimeZone.setDefault(null);
  LogManager.getLogManager().reset();
  new AndroidConfig();
  String userAgent=getDefaultUserAgent();
  System.setProperty("String_Node_Str",userAgent);
  String trace=SystemProperties.get("String_Node_Str");
  if (trace.equals("String_Node_Str")) {
    Slog.i(TAG,"String_Node_Str");
    Debug.enableEmulatorTraceOutput();
  }
  initialized=true;
}
Program: 22888
Project: 22888
Buggy source:
public void uncaughtException(Thread t,Throwable e){
  try {
    if (mCrashing)     return;
    mCrashing=true;
    if (mApplicationObject == null) {
      Log.e(TAG,"String_Node_Str" + t.getName(),e);
    }
 else {
      Log.e(TAG,"String_Node_Str" + t.getName(),e);
    }
    ActivityManagerNative.getDefault().handleApplicationCrash(mApplicationObject,new ApplicationErrorReport.CrashInfo(e));
  }
 catch (  Throwable t2) {
    try {
      Log.e(TAG,"String_Node_Str",t2);
    }
 catch (    Throwable t3) {
    }
  }
 finally {
    Process.killProcess(Process.myPid());
    System.exit(10);
  }
}

Fixed version (ground truth):
public void uncaughtException(Thread t,Throwable e){
  try {
    if (mCrashing)     return;
    mCrashing=true;
    if (mApplicationObject == null) {
      Slog.e(TAG,"String_Node_Str" + t.getName(),e);
    }
 else {
      Slog.e(TAG,"String_Node_Str" + t.getName(),e);
    }
    ActivityManagerNative.getDefault().handleApplicationCrash(mApplicationObject,new ApplicationErrorReport.CrashInfo(e));
  }
 catch (  Throwable t2) {
    try {
      Slog.e(TAG,"String_Node_Str",t2);
    }
 catch (    Throwable t3) {
    }
  }
 finally {
    Process.killProcess(Process.myPid());
    System.exit(10);
  }
}
Program: 22889
Project: 22889
Buggy source:
public void clearWallpaperLocked(){
  File f=WALLPAPER_FILE;
  if (f.exists()) {
    f.delete();
  }
  final long ident=Binder.clearCallingIdentity();
  try {
    bindWallpaperComponentLocked(null);
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
public void clearWallpaperLocked(){
  File f=WALLPAPER_FILE;
  if (f.exists()) {
    f.delete();
  }
  final long ident=Binder.clearCallingIdentity();
  try {
    bindWallpaperComponentLocked(null);
  }
 catch (  IllegalArgumentException e) {
    Slog.e(TAG,"String_Node_Str",e);
  }
 finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 22890
Project: 22890
Buggy source:
/** 
 * Reboot the device immediately, passing 'reason' (may be null) to the underlying __reboot system call.  Should not return.
 */
public void reboot(String reason){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.REBOOT,null);
  if (mHandler == null || !ActivityManagerNative.isSystemReady()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final String finalReason=reason;
  Runnable runnable=new Runnable(){
    public void run(){
synchronized (this) {
        ShutdownThread.reboot(mContext,finalReason,false);
        notify();
      }
    }
  }
;
  mHandler.post(runnable);
synchronized (runnable) {
    try {
      runnable.wait();
    }
 catch (    InterruptedException e) {
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Reboot the device immediately, passing 'reason' (may be null) to the underlying __reboot system call.  Should not return.
 */
public void reboot(String reason){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.REBOOT,null);
  if (mHandler == null || !ActivityManagerNative.isSystemReady()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final String finalReason=reason;
  Runnable runnable=new Runnable(){
    public void run(){
synchronized (this) {
        ShutdownThread.reboot(mContext,finalReason,false);
      }
    }
  }
;
  mHandler.post(runnable);
synchronized (runnable) {
    while (true) {
      try {
        runnable.wait();
      }
 catch (      InterruptedException e) {
      }
    }
  }
}
Program: 22892
Project: 22892
Buggy source:
/** 
 * Reboot the device immediately, passing 'reason' (may be null) to the underlying __reboot system call.  Should not return.
 */
public void reboot(String reason){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.REBOOT,null);
  if (mHandler == null || !ActivityManagerNative.isSystemReady()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final String finalReason=reason;
  Runnable runnable=new Runnable(){
    public void run(){
synchronized (this) {
        ShutdownThread.reboot(mContext,finalReason,false);
        notify();
      }
    }
  }
;
  mHandler.post(runnable);
synchronized (runnable) {
    try {
      runnable.wait();
    }
 catch (    InterruptedException e) {
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Reboot the device immediately, passing 'reason' (may be null) to the underlying __reboot system call.  Should not return.
 */
public void reboot(String reason){
  mContext.enforceCallingOrSelfPermission(android.Manifest.permission.REBOOT,null);
  if (mHandler == null || !ActivityManagerNative.isSystemReady()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final String finalReason=reason;
  Runnable runnable=new Runnable(){
    public void run(){
synchronized (this) {
        ShutdownThread.reboot(mContext,finalReason,false);
      }
    }
  }
;
  mHandler.post(runnable);
synchronized (runnable) {
    while (true) {
      try {
        runnable.wait();
      }
 catch (      InterruptedException e) {
      }
    }
  }
}