nus-yam/ex-repair huggingface dataset:
Program: 183024
Project: 183024
Buggy source:
private static void beginShutdownSequence(Context context){
synchronized (sIsStartedGuard) {
    sIsStarted=true;
  }
  ProgressDialog pd=new ProgressDialog(context);
  pd.setTitle(context.getText(com.android.internal.R.string.power_off));
  pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  pd.show();
  sInstance.mContext=context;
  sInstance.mHandler=new Handler(){
  }
;
  sInstance.start();
}

Fixed version (ground truth):
private static void beginShutdownSequence(Context context){
synchronized (sIsStartedGuard) {
    sIsStarted=true;
  }
  ProgressDialog pd=new ProgressDialog(context);
  pd.setTitle(context.getText(com.android.internal.R.string.power_off));
  pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  if (!context.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  pd.show();
  sInstance.mContext=context;
  sInstance.mHandler=new Handler(){
  }
;
  sInstance.start();
}
Program: 183025
Project: 183025
Buggy source:
/** 
 * Request a clean shutdown, waiting for subsystems to clean up their state etc.  Must be called from a Looper thread in which its UI is shown.
 * @param context Context used to display the shutdown progress dialog.
 */
public static void shutdown(final Context context,boolean confirm){
synchronized (sIsStartedGuard) {
    if (sIsStarted) {
      Log.d(TAG,"String_Node_Str");
      return;
    }
  }
  Log.d(TAG,"String_Node_Str");
  if (confirm) {
    final AlertDialog dialog=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(com.android.internal.R.string.power_off).setMessage(com.android.internal.R.string.shutdown_confirm).setPositiveButton(com.android.internal.R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int which){
        beginShutdownSequence(context);
      }
    }
).setNegativeButton(com.android.internal.R.string.no,null).create();
    dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    dialog.show();
  }
 else {
    beginShutdownSequence(context);
  }
}

Fixed version (ground truth):
/** 
 * Request a clean shutdown, waiting for subsystems to clean up their state etc.  Must be called from a Looper thread in which its UI is shown.
 * @param context Context used to display the shutdown progress dialog.
 */
public static void shutdown(final Context context,boolean confirm){
synchronized (sIsStartedGuard) {
    if (sIsStarted) {
      Log.d(TAG,"String_Node_Str");
      return;
    }
  }
  Log.d(TAG,"String_Node_Str");
  if (confirm) {
    final AlertDialog dialog=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(com.android.internal.R.string.power_off).setMessage(com.android.internal.R.string.shutdown_confirm).setPositiveButton(com.android.internal.R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int which){
        beginShutdownSequence(context);
      }
    }
).setNegativeButton(com.android.internal.R.string.no,null).create();
    dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    if (!context.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
      dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }
    dialog.show();
  }
 else {
    beginShutdownSequence(context);
  }
}
Program: 183026
Project: 183026
Buggy source:
private Dialog getProgressDialog(){
  if (mCheckingDialog == null) {
    mCheckingDialog=new ProgressDialog(mContext);
    mCheckingDialog.setMessage(mContext.getString(R.string.lockscreen_glogin_checking_password));
    mCheckingDialog.setIndeterminate(true);
    mCheckingDialog.setCancelable(false);
    mCheckingDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    mCheckingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  return mCheckingDialog;
}

Fixed version (ground truth):
private Dialog getProgressDialog(){
  if (mCheckingDialog == null) {
    mCheckingDialog=new ProgressDialog(mContext);
    mCheckingDialog.setMessage(mContext.getString(R.string.lockscreen_glogin_checking_password));
    mCheckingDialog.setIndeterminate(true);
    mCheckingDialog.setCancelable(false);
    mCheckingDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
      mCheckingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }
  }
  return mCheckingDialog;
}
Program: 183028
Project: 183028
Buggy source:
private void showAlmostAtAccountLoginDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_failed_attempts_almost_glogin,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  dialog.show();
}

Fixed version (ground truth):
private void showAlmostAtAccountLoginDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_failed_attempts_almost_glogin,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  dialog.show();
}
Program: 183029
Project: 183029
Buggy source:
private void showTimeoutDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_too_many_failed_attempts_dialog_message,mUpdateMonitor.getFailedAttempts(),timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  dialog.show();
}

Fixed version (ground truth):
private void showTimeoutDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_too_many_failed_attempts_dialog_message,mUpdateMonitor.getFailedAttempts(),timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  dialog.show();
}
Program: 183031
Project: 183031
Buggy source:
private Dialog getSimUnlockProgressDialog(){
  if (mSimUnlockProgressDialog == null) {
    mSimUnlockProgressDialog=new ProgressDialog(mContext);
    mSimUnlockProgressDialog.setMessage(mContext.getString(R.string.lockscreen_sim_unlock_progress_dialog_message));
    mSimUnlockProgressDialog.setIndeterminate(true);
    mSimUnlockProgressDialog.setCancelable(false);
    mSimUnlockProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    mSimUnlockProgressDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  return mSimUnlockProgressDialog;
}

Fixed version (ground truth):
private Dialog getSimUnlockProgressDialog(){
  if (mSimUnlockProgressDialog == null) {
    mSimUnlockProgressDialog=new ProgressDialog(mContext);
    mSimUnlockProgressDialog.setMessage(mContext.getString(R.string.lockscreen_sim_unlock_progress_dialog_message));
    mSimUnlockProgressDialog.setIndeterminate(true);
    mSimUnlockProgressDialog.setCancelable(false);
    mSimUnlockProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
      mSimUnlockProgressDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }
  }
  return mSimUnlockProgressDialog;
}
Program: 183032
Project: 183032
Buggy source:
private static void beginShutdownSequence(Context context){
synchronized (sIsStartedGuard) {
    sIsStarted=true;
  }
  ProgressDialog pd=new ProgressDialog(context);
  pd.setTitle(context.getText(com.android.internal.R.string.power_off));
  pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  pd.show();
  sInstance.mContext=context;
  sInstance.mHandler=new Handler(){
  }
;
  sInstance.start();
}

Fixed version (ground truth):
private static void beginShutdownSequence(Context context){
synchronized (sIsStartedGuard) {
    sIsStarted=true;
  }
  ProgressDialog pd=new ProgressDialog(context);
  pd.setTitle(context.getText(com.android.internal.R.string.power_off));
  pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  if (!context.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  pd.show();
  sInstance.mContext=context;
  sInstance.mHandler=new Handler(){
  }
;
  sInstance.start();
}
Program: 183033
Project: 183033
Buggy source:
/** 
 * Request a clean shutdown, waiting for subsystems to clean up their state etc.  Must be called from a Looper thread in which its UI is shown.
 * @param context Context used to display the shutdown progress dialog.
 */
public static void shutdown(final Context context,boolean confirm){
synchronized (sIsStartedGuard) {
    if (sIsStarted) {
      Log.d(TAG,"String_Node_Str");
      return;
    }
  }
  Log.d(TAG,"String_Node_Str");
  if (confirm) {
    final AlertDialog dialog=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(com.android.internal.R.string.power_off).setMessage(com.android.internal.R.string.shutdown_confirm).setPositiveButton(com.android.internal.R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int which){
        beginShutdownSequence(context);
      }
    }
).setNegativeButton(com.android.internal.R.string.no,null).create();
    dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    dialog.show();
  }
 else {
    beginShutdownSequence(context);
  }
}

Fixed version (ground truth):
/** 
 * Request a clean shutdown, waiting for subsystems to clean up their state etc.  Must be called from a Looper thread in which its UI is shown.
 * @param context Context used to display the shutdown progress dialog.
 */
public static void shutdown(final Context context,boolean confirm){
synchronized (sIsStartedGuard) {
    if (sIsStarted) {
      Log.d(TAG,"String_Node_Str");
      return;
    }
  }
  Log.d(TAG,"String_Node_Str");
  if (confirm) {
    final AlertDialog dialog=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(com.android.internal.R.string.power_off).setMessage(com.android.internal.R.string.shutdown_confirm).setPositiveButton(com.android.internal.R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int which){
        beginShutdownSequence(context);
      }
    }
).setNegativeButton(com.android.internal.R.string.no,null).create();
    dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    if (!context.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
      dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }
    dialog.show();
  }
 else {
    beginShutdownSequence(context);
  }
}
Program: 183034
Project: 183034
Buggy source:
private static void beginShutdownSequence(Context context){
synchronized (sIsStartedGuard) {
    sIsStarted=true;
  }
  ProgressDialog pd=new ProgressDialog(context);
  pd.setTitle(context.getText(com.android.internal.R.string.power_off));
  pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  pd.show();
  sInstance.mContext=context;
  sInstance.mHandler=new Handler(){
  }
;
  sInstance.start();
}

Fixed version (ground truth):
private static void beginShutdownSequence(Context context){
synchronized (sIsStartedGuard) {
    sIsStarted=true;
  }
  ProgressDialog pd=new ProgressDialog(context);
  pd.setTitle(context.getText(com.android.internal.R.string.power_off));
  pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
  pd.setIndeterminate(true);
  pd.setCancelable(false);
  pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  if (!context.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  pd.show();
  sInstance.mContext=context;
  sInstance.mHandler=new Handler(){
  }
;
  sInstance.start();
}
Program: 183035
Project: 183035
Buggy source:
/** 
 * Request a clean shutdown, waiting for subsystems to clean up their state etc.  Must be called from a Looper thread in which its UI is shown.
 * @param context Context used to display the shutdown progress dialog.
 */
public static void shutdown(final Context context,boolean confirm){
synchronized (sIsStartedGuard) {
    if (sIsStarted) {
      Log.d(TAG,"String_Node_Str");
      return;
    }
  }
  Log.d(TAG,"String_Node_Str");
  if (confirm) {
    final AlertDialog dialog=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(com.android.internal.R.string.power_off).setMessage(com.android.internal.R.string.shutdown_confirm).setPositiveButton(com.android.internal.R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int which){
        beginShutdownSequence(context);
      }
    }
).setNegativeButton(com.android.internal.R.string.no,null).create();
    dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    dialog.show();
  }
 else {
    beginShutdownSequence(context);
  }
}

Fixed version (ground truth):
/** 
 * Request a clean shutdown, waiting for subsystems to clean up their state etc.  Must be called from a Looper thread in which its UI is shown.
 * @param context Context used to display the shutdown progress dialog.
 */
public static void shutdown(final Context context,boolean confirm){
synchronized (sIsStartedGuard) {
    if (sIsStarted) {
      Log.d(TAG,"String_Node_Str");
      return;
    }
  }
  Log.d(TAG,"String_Node_Str");
  if (confirm) {
    final AlertDialog dialog=new AlertDialog.Builder(context).setIcon(android.R.drawable.ic_dialog_alert).setTitle(com.android.internal.R.string.power_off).setMessage(com.android.internal.R.string.shutdown_confirm).setPositiveButton(com.android.internal.R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int which){
        beginShutdownSequence(context);
      }
    }
).setNegativeButton(com.android.internal.R.string.no,null).create();
    dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    if (!context.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
      dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }
    dialog.show();
  }
 else {
    beginShutdownSequence(context);
  }
}
Program: 183036
Project: 183036
Buggy source:
void updatePlugged(){
  Intent powerIntent=mContext.registerReceiver(null,mBatteryStatusFilter);
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + powerIntent.getExtras());
  if (powerIntent != null) {
    mPlugged=powerIntent.getIntExtra(BatteryManager.EXTRA_PLUGGED,0);
    if (localLOGV)     Log.v(TAG,"String_Node_Str" + mPlugged);
  }
}

Fixed version (ground truth):
void updatePlugged(Intent powerIntent){
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + powerIntent.getExtras());
  if (powerIntent != null) {
    mPlugged=powerIntent.getIntExtra(BatteryManager.EXTRA_PLUGGED,0);
    if (localLOGV)     Log.v(TAG,"String_Node_Str" + mPlugged);
  }
}
Program: 183038
Project: 183038
Buggy source:
public void onReceive(Context context,Intent intent){
  mDockState=intent.getIntExtra(Intent.EXTRA_DOCK_STATE,Intent.EXTRA_DOCK_STATE_UNDOCKED);
  updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
  updateKeepScreenOn();
  updateOrientationListenerLp();
}

Fixed version (ground truth):
public void onReceive(Context context,Intent intent){
  mDockState=intent.getIntExtra(Intent.EXTRA_DOCK_STATE,Intent.EXTRA_DOCK_STATE_UNDOCKED);
  boolean watchBattery=mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;
  if (watchBattery != mRegisteredBatteryReceiver) {
    mRegisteredBatteryReceiver=watchBattery;
    if (watchBattery) {
      updatePlugged(mContext.registerReceiver(mBatteryReceiver,mBatteryStatusFilter));
    }
 else {
      mContext.unregisterReceiver(mBatteryReceiver);
    }
  }
  updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
  updateDockKeepingScreenOn();
  updateOrientationListenerLp();
}
Program: 183039
Project: 183039
Buggy source:
private Dialog getProgressDialog(){
  if (mCheckingDialog == null) {
    mCheckingDialog=new ProgressDialog(mContext);
    mCheckingDialog.setMessage(mContext.getString(R.string.lockscreen_glogin_checking_password));
    mCheckingDialog.setIndeterminate(true);
    mCheckingDialog.setCancelable(false);
    mCheckingDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    mCheckingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  return mCheckingDialog;
}

Fixed version (ground truth):
private Dialog getProgressDialog(){
  if (mCheckingDialog == null) {
    mCheckingDialog=new ProgressDialog(mContext);
    mCheckingDialog.setMessage(mContext.getString(R.string.lockscreen_glogin_checking_password));
    mCheckingDialog.setIndeterminate(true);
    mCheckingDialog.setCancelable(false);
    mCheckingDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
      mCheckingDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }
  }
  return mCheckingDialog;
}
Program: 183041
Project: 183041
Buggy source:
private void showAlmostAtAccountLoginDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_failed_attempts_almost_glogin,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  dialog.show();
}

Fixed version (ground truth):
private void showAlmostAtAccountLoginDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_failed_attempts_almost_glogin,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT,timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  dialog.show();
}
Program: 183042
Project: 183042
Buggy source:
private void showTimeoutDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_too_many_failed_attempts_dialog_message,mUpdateMonitor.getFailedAttempts(),timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  dialog.show();
}

Fixed version (ground truth):
private void showTimeoutDialog(){
  int timeoutInSeconds=(int)LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
  String message=mContext.getString(R.string.lockscreen_too_many_failed_attempts_dialog_message,mUpdateMonitor.getFailedAttempts(),timeoutInSeconds);
  final AlertDialog dialog=new AlertDialog.Builder(mContext).setTitle(null).setMessage(message).setNeutralButton(R.string.ok,null).create();
  dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
  if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
    dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  dialog.show();
}
Program: 183044
Project: 183044
Buggy source:
private Dialog getSimUnlockProgressDialog(){
  if (mSimUnlockProgressDialog == null) {
    mSimUnlockProgressDialog=new ProgressDialog(mContext);
    mSimUnlockProgressDialog.setMessage(mContext.getString(R.string.lockscreen_sim_unlock_progress_dialog_message));
    mSimUnlockProgressDialog.setIndeterminate(true);
    mSimUnlockProgressDialog.setCancelable(false);
    mSimUnlockProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    mSimUnlockProgressDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
  }
  return mSimUnlockProgressDialog;
}

Fixed version (ground truth):
private Dialog getSimUnlockProgressDialog(){
  if (mSimUnlockProgressDialog == null) {
    mSimUnlockProgressDialog=new ProgressDialog(mContext);
    mSimUnlockProgressDialog.setMessage(mContext.getString(R.string.lockscreen_sim_unlock_progress_dialog_message));
    mSimUnlockProgressDialog.setIndeterminate(true);
    mSimUnlockProgressDialog.setCancelable(false);
    mSimUnlockProgressDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_sf_slowBlur)) {
      mSimUnlockProgressDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    }
  }
  return mSimUnlockProgressDialog;
}
Program: 183045
Project: 183045
Buggy source:
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      removeProviderLocked(provider);
    }
  }
}

Fixed version (ground truth):
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
  String name=null;
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      name=removeProviderLocked(provider);
    }
  }
  if (name != null) {
    try {
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str" + name);
      ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),name);
    }
 catch (    RemoteException e) {
    }
  }
}
Program: 183046
Project: 183046
Buggy source:
public final void removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return;
  }
  IBinder providerBinder=provider.asBinder();
  boolean amRemoveFlag=false;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (!amRemoveFlag) {
        try {
          if (localLOGV)           Log.v(TAG,"String_Node_Str" + "String_Node_Str" + pr.mName);
          ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),pr.mName);
          amRemoveFlag=true;
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public final String removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return null;
  }
  IBinder providerBinder=provider.asBinder();
  String name=null;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return name;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (name == null) {
        name=pr.mName;
      }
    }
  }
  return name;
}
Program: 183048
Project: 183048
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      Integer cnt=r.conProviders.get(localCpr);
      if (cnt == null || cnt.intValue() <= 1) {
        localCpr.clients.remove(r);
        r.conProviders.remove(localCpr);
      }
 else {
        r.conProviders.put(localCpr,new Integer(cnt.intValue() - 1));
      }
    }
    updateOomAdjLocked();
  }
}
Program: 183050
Project: 183050
Buggy source:
void updatePlugged(){
  Intent powerIntent=mContext.registerReceiver(null,mBatteryStatusFilter);
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + powerIntent.getExtras());
  if (powerIntent != null) {
    mPlugged=powerIntent.getIntExtra(BatteryManager.EXTRA_PLUGGED,0);
    if (localLOGV)     Log.v(TAG,"String_Node_Str" + mPlugged);
  }
}

Fixed version (ground truth):
void updatePlugged(Intent powerIntent){
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + powerIntent.getExtras());
  if (powerIntent != null) {
    mPlugged=powerIntent.getIntExtra(BatteryManager.EXTRA_PLUGGED,0);
    if (localLOGV)     Log.v(TAG,"String_Node_Str" + mPlugged);
  }
}
Program: 183052
Project: 183052
Buggy source:
public void onReceive(Context context,Intent intent){
  mDockState=intent.getIntExtra(Intent.EXTRA_DOCK_STATE,Intent.EXTRA_DOCK_STATE_UNDOCKED);
  updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
  updateKeepScreenOn();
  updateOrientationListenerLp();
}

Fixed version (ground truth):
public void onReceive(Context context,Intent intent){
  mDockState=intent.getIntExtra(Intent.EXTRA_DOCK_STATE,Intent.EXTRA_DOCK_STATE_UNDOCKED);
  boolean watchBattery=mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED;
  if (watchBattery != mRegisteredBatteryReceiver) {
    mRegisteredBatteryReceiver=watchBattery;
    if (watchBattery) {
      updatePlugged(mContext.registerReceiver(mBatteryReceiver,mBatteryStatusFilter));
    }
 else {
      mContext.unregisterReceiver(mBatteryReceiver);
    }
  }
  updateRotation(Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE);
  updateDockKeepingScreenOn();
  updateOrientationListenerLp();
}
Program: 183054
Project: 183054
Buggy source:
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      removeProviderLocked(provider);
    }
  }
}

Fixed version (ground truth):
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
  String name=null;
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      name=removeProviderLocked(provider);
    }
  }
  if (name != null) {
    try {
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str" + name);
      ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),name);
    }
 catch (    RemoteException e) {
    }
  }
}
Program: 183055
Project: 183055
Buggy source:
public final void removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return;
  }
  IBinder providerBinder=provider.asBinder();
  boolean amRemoveFlag=false;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (!amRemoveFlag) {
        try {
          if (localLOGV)           Log.v(TAG,"String_Node_Str" + "String_Node_Str" + pr.mName);
          ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),pr.mName);
          amRemoveFlag=true;
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public final String removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return null;
  }
  IBinder providerBinder=provider.asBinder();
  String name=null;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return name;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (name == null) {
        name=pr.mName;
      }
    }
  }
  return name;
}
Program: 183057
Project: 183057
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      Integer cnt=r.conProviders.get(localCpr);
      if (cnt == null || cnt.intValue() <= 1) {
        localCpr.clients.remove(r);
        r.conProviders.remove(localCpr);
      }
 else {
        r.conProviders.put(localCpr,new Integer(cnt.intValue() - 1));
      }
    }
    updateOomAdjLocked();
  }
}
Program: 183059
Project: 183059
Buggy source:
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      removeProviderLocked(provider);
    }
  }
}

Fixed version (ground truth):
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
  String name=null;
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      name=removeProviderLocked(provider);
    }
  }
  if (name != null) {
    try {
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str" + name);
      ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),name);
    }
 catch (    RemoteException e) {
    }
  }
}
Program: 183060
Project: 183060
Buggy source:
public final void removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return;
  }
  IBinder providerBinder=provider.asBinder();
  boolean amRemoveFlag=false;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (!amRemoveFlag) {
        try {
          if (localLOGV)           Log.v(TAG,"String_Node_Str" + "String_Node_Str" + pr.mName);
          ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),pr.mName);
          amRemoveFlag=true;
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public final String removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return null;
  }
  IBinder providerBinder=provider.asBinder();
  String name=null;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return name;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (name == null) {
        name=pr.mName;
      }
    }
  }
  return name;
}
Program: 183062
Project: 183062
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      Integer cnt=r.conProviders.get(localCpr);
      if (cnt == null || cnt.intValue() <= 1) {
        localCpr.clients.remove(r);
        r.conProviders.remove(localCpr);
      }
 else {
        r.conProviders.put(localCpr,new Integer(cnt.intValue() - 1));
      }
    }
    updateOomAdjLocked();
  }
}
Program: 183064
Project: 183064
Buggy source:
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      removeProviderLocked(provider);
    }
  }
}

Fixed version (ground truth):
final void completeRemoveProvider(IContentProvider provider){
  IBinder jBinder=provider.asBinder();
  String name=null;
synchronized (mProviderMap) {
    ProviderRefCount prc=mProviderRefCountMap.get(jBinder);
    if (prc != null && prc.count == 0) {
      mProviderRefCountMap.remove(jBinder);
      name=removeProviderLocked(provider);
    }
  }
  if (name != null) {
    try {
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str" + name);
      ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),name);
    }
 catch (    RemoteException e) {
    }
  }
}
Program: 183065
Project: 183065
Buggy source:
public final void removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return;
  }
  IBinder providerBinder=provider.asBinder();
  boolean amRemoveFlag=false;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (!amRemoveFlag) {
        try {
          if (localLOGV)           Log.v(TAG,"String_Node_Str" + "String_Node_Str" + pr.mName);
          ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread(),pr.mName);
          amRemoveFlag=true;
        }
 catch (        RemoteException e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public final String removeProviderLocked(IContentProvider provider){
  if (provider == null) {
    return null;
  }
  IBinder providerBinder=provider.asBinder();
  String name=null;
  Iterator<ProviderRecord> iter=mProviderMap.values().iterator();
  while (iter.hasNext()) {
    ProviderRecord pr=iter.next();
    IBinder myBinder=pr.mProvider.asBinder();
    if (myBinder == providerBinder) {
      if (pr.mLocalProvider != null) {
        if (localLOGV)         Log.i(TAG,"String_Node_Str");
        return name;
      }
      if (localLOGV)       Log.v(TAG,"String_Node_Str" + "String_Node_Str");
      myBinder.unlinkToDeath(pr,0);
      iter.remove();
      if (name == null) {
        name=pr.mName;
      }
    }
  }
  return name;
}
Program: 183067
Project: 183067
Buggy source:
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      localCpr.clients.remove(r);
      r.conProviders.remove(localCpr);
    }
    updateOomAdjLocked();
  }
}

Fixed version (ground truth):
/** 
 * Drop a content provider from a ProcessRecord's bookkeeping
 * @param cpr
 */
public void removeContentProvider(IApplicationThread caller,String name){
synchronized (this) {
    ContentProviderRecord cpr=(ContentProviderRecord)mProvidersByName.get(name);
    if (cpr == null) {
      if (DEBUG_PROVIDER)       Log.v(TAG,name + "String_Node_Str");
      return;
    }
    final ProcessRecord r=getRecordForAppLocked(caller);
    if (r == null) {
      throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ name);
    }
    ContentProviderRecord localCpr=(ContentProviderRecord)mProvidersByClass.get(cpr.info.name);
    if (DEBUG_PROVIDER)     Log.v(TAG,"String_Node_Str" + r.info.processName + "String_Node_Str"+ localCpr.appInfo.processName);
    if (localCpr.app == r) {
      Log.w(TAG,"String_Node_Str" + cpr.info.name + "String_Node_Str"+ r.processName);
      return;
    }
 else {
      Integer cnt=r.conProviders.get(localCpr);
      if (cnt == null || cnt.intValue() <= 1) {
        localCpr.clients.remove(r);
        r.conProviders.remove(localCpr);
      }
 else {
        r.conProviders.put(localCpr,new Integer(cnt.intValue() - 1));
      }
    }
    updateOomAdjLocked();
  }
}
Program: 183069
Project: 183069
Buggy source:
public void destroy(){
  nContextDestroy(mContext);
  mContext=0;
  nDeviceDestroy(mDev);
  mDev=0;
}

Fixed version (ground truth):
public void destroy(){
  nContextDeinitToClient();
  mMessageThread.mRun=false;
  nContextDestroy(mContext);
  mContext=0;
  nDeviceDestroy(mDev);
  mDev=0;
}
Program: 183070
Project: 183070
Buggy source:
public RenderScript(Surface sur,boolean useDepth,boolean forceSW){
  mSurface=sur;
  mDev=nDeviceCreate();
  if (forceSW) {
    nDeviceSetConfig(mDev,0,1);
  }
  mContext=nContextCreate(mDev,mSurface,0,useDepth);
  Element.initPredefined(this);
}

Fixed version (ground truth):
public RenderScript(Surface sur,boolean useDepth,boolean forceSW){
  mSurface=sur;
  mDev=nDeviceCreate();
  if (forceSW) {
    nDeviceSetConfig(mDev,0,1);
  }
  mContext=nContextCreate(mDev,mSurface,0,useDepth);
  Element.initPredefined(this);
  mMessageThread=new MessageThread(this);
  mMessageThread.start();
}