nus-yam/ex-repair huggingface dataset:
Program: 182304
Project: 182304
Buggy source:
/** 
 * Stay on me, but recreate me (so I can use a different layout).
 */
void recreateMe();

Fixed version (ground truth):
/** 
 * Stay on me, but recreate me (so I can use a different layout).
 */
void recreateMe(Configuration config);
Program: 182305
Project: 182305
Buggy source:
/** 
 * Remove the given observer from being registered from any of the kinds of callbacks.
 * @param observer The observer to remove (an instance of {@link ConfigurationChangeCallback},  {@link InfoCallback} or {@link SimStateCallback}
 */
public void removeCallback(Object observer){
  mConfigurationChangeCallbacks.remove(observer);
  mInfoCallbacks.remove(observer);
  mSimStateCallbacks.remove(observer);
}

Fixed version (ground truth):
/** 
 * Remove the given observer from being registered from any of the kinds of callbacks.
 * @param observer The observer to remove (an instance of {@link ConfigurationChangeCallback},  {@link InfoCallback} or {@link SimStateCallback}
 */
public void removeCallback(Object observer){
  mInfoCallbacks.remove(observer);
  mSimStateCallbacks.remove(observer);
}
Program: 182307
Project: 182307
Buggy source:
@Override public void handleMessage(Message msg){
switch (msg.what) {
case MSG_CONFIGURATION_CHANGED:
    handleConfigurationChange();
  break;
case MSG_TIME_UPDATE:
handleTimeUpdate();
break;
case MSG_BATTERY_UPDATE:
handleBatteryUpdate(msg.arg1,msg.arg2);
break;
case MSG_CARRIER_INFO_UPDATE:
handleCarrierInfoUpdate();
break;
case MSG_SIM_STATE_CHANGE:
handleSimStateChange((SimArgs)msg.obj);
break;
case MSG_RINGER_MODE_CHANGED:
handleRingerModeChange(msg.arg1);
break;
case MSG_PHONE_STATE_CHANGED:
handlePhoneStateChanged((String)msg.obj);
break;
}
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
switch (msg.what) {
case MSG_TIME_UPDATE:
    handleTimeUpdate();
  break;
case MSG_BATTERY_UPDATE:
handleBatteryUpdate(msg.arg1,msg.arg2);
break;
case MSG_CARRIER_INFO_UPDATE:
handleCarrierInfoUpdate();
break;
case MSG_SIM_STATE_CHANGE:
handleSimStateChange((SimArgs)msg.obj);
break;
case MSG_RINGER_MODE_CHANGED:
handleRingerModeChange(msg.arg1);
break;
case MSG_PHONE_STATE_CHANGED:
handlePhoneStateChanged((String)msg.obj);
break;
}
}
Program: 182309
Project: 182309
Buggy source:
View createLockScreen(){
  return new LockScreen(mContext,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback);
}

Fixed version (ground truth):
View createLockScreen(){
  return new LockScreen(mContext,mConfiguration,mLockPatternUtils,mUpdateMonitor,mKeyguardScreenCallback);
}
Program: 182311
Project: 182311
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: 182312
Project: 182312
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: 182313
Project: 182313
Buggy source:
public void recreateMe(){
  recreateScreens();
}

Fixed version (ground truth):
public void recreateMe(Configuration config){
  mConfiguration=config;
  recreateScreens();
}
Program: 182314
Project: 182314
Buggy source:
/** 
 * @param contentResolver Used to look up and save settings.
 */
public LockPatternUtils(Context context){
  mContext=context;
  mContentResolver=context.getContentResolver();
  mDevicePolicyManager=getDevicePolicyManager();
  if (sLockPatternFilename == null) {
    sLockPatternFilename=android.os.Environment.getDataDirectory().getAbsolutePath() + LOCK_PATTERN_FILE;
    sLockPasswordFilename=android.os.Environment.getDataDirectory().getAbsolutePath() + LOCK_PASSWORD_FILE;
  }
}

Fixed version (ground truth):
/** 
 * @param contentResolver Used to look up and save settings.
 */
public LockPatternUtils(Context context){
  mContext=context;
  mContentResolver=context.getContentResolver();
  if (sLockPatternFilename == null) {
    sLockPatternFilename=android.os.Environment.getDataDirectory().getAbsolutePath() + LOCK_PATTERN_FILE;
    sLockPasswordFilename=android.os.Environment.getDataDirectory().getAbsolutePath() + LOCK_PASSWORD_FILE;
  }
}
Program: 182315
Project: 182315
Buggy source:
public void testScreenRequestsRecreation(){
  mLPKV.wakeWhenReadyTq(0);
  mLPKV.onScreenTurnedOn();
  assertEquals(1,mLPKV.getInjectedLockScreens().size());
  assertEquals(1,mLPKV.getInjectedUnlockScreens().size());
  MockKeyguardScreen lockScreen=mLPKV.getInjectedLockScreens().get(0);
  assertEquals(0,lockScreen.getOnPauseCount());
  assertEquals(1,lockScreen.getOnResumeCount());
  mLPKV.mKeyguardScreenCallback.recreateMe();
  assertEquals(2,mLPKV.getInjectedLockScreens().size());
  assertEquals(2,mLPKV.getInjectedUnlockScreens().size());
  assertEquals(1,mLPKV.getInjectedLockScreens().get(0).getCleanupCount());
  assertEquals(1,mLPKV.getInjectedUnlockScreens().get(0).getCleanupCount());
  assertEquals(1,mLPKV.getInjectedLockScreens().get(0).getOnPauseCount());
  assertEquals(0,mLPKV.getInjectedUnlockScreens().get(0).getOnPauseCount());
  assertEquals(1,mLPKV.getInjectedLockScreens().get(1).getOnResumeCount());
  assertEquals(0,mLPKV.getInjectedUnlockScreens().get(1).getOnResumeCount());
}

Fixed version (ground truth):
public void testScreenRequestsRecreation(){
  mLPKV.wakeWhenReadyTq(0);
  mLPKV.onScreenTurnedOn();
  assertEquals(1,mLPKV.getInjectedLockScreens().size());
  assertEquals(1,mLPKV.getInjectedUnlockScreens().size());
  MockKeyguardScreen lockScreen=mLPKV.getInjectedLockScreens().get(0);
  assertEquals(0,lockScreen.getOnPauseCount());
  assertEquals(1,lockScreen.getOnResumeCount());
  mLPKV.mKeyguardScreenCallback.recreateMe(new Configuration());
  assertEquals(2,mLPKV.getInjectedLockScreens().size());
  assertEquals(2,mLPKV.getInjectedUnlockScreens().size());
  assertEquals(1,mLPKV.getInjectedLockScreens().get(0).getCleanupCount());
  assertEquals(1,mLPKV.getInjectedUnlockScreens().get(0).getCleanupCount());
  assertEquals(1,mLPKV.getInjectedLockScreens().get(0).getOnPauseCount());
  assertEquals(0,mLPKV.getInjectedUnlockScreens().get(0).getOnPauseCount());
  assertEquals(1,mLPKV.getInjectedLockScreens().get(1).getOnResumeCount());
  assertEquals(0,mLPKV.getInjectedUnlockScreens().get(1).getOnResumeCount());
}
Program: 182318
Project: 182318
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: 182319
Project: 182319
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: 182320
Project: 182320
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: 182321
Project: 182321
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: 182322
Project: 182322
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: 182323
Project: 182323
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: 182325
Project: 182325
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: 182327
Project: 182327
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: 182328
Project: 182328
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: 182329
Project: 182329
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: 182332
Project: 182332
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: 182333
Project: 182333
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: 182334
Project: 182334
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: 182335
Project: 182335
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: 182336
Project: 182336
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: 182337
Project: 182337
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: 182338
Project: 182338
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: 182339
Project: 182339
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: 182340
Project: 182340
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: 182341
Project: 182341
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: 182342
Project: 182342
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: 182345
Project: 182345
Buggy source:
/** 
 * Searches for an entry in the CalendarAlerts table that matches the given event id, begin time and alarm time.  If one is found then this alarm already exists and this method returns true.
 * @param cr the ContentResolver
 * @param eventId the event id to match
 * @param begin the start time of the event in UTC millis
 * @param alarmTime the alarm time of the event in UTC millis
 * @return true if there is already an alarm for the given eventwith the same start time and alarm time.
 */
public static final boolean alarmExists(ContentResolver cr,long eventId,long begin,long alarmTime){
  String selection=CalendarAlerts.EVENT_ID + "String_Node_Str" + eventId+ "String_Node_Str"+ CalendarAlerts.BEGIN+ "String_Node_Str"+ begin+ "String_Node_Str"+ CalendarAlerts.ALARM_TIME+ "String_Node_Str"+ alarmTime;
  String[] projection=new String[]{CalendarAlerts.ALARM_TIME};
  Cursor cursor=query(cr,projection,selection,null,null);
  boolean found=false;
  try {
    if (cursor != null && cursor.getCount() > 0) {
      found=true;
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return found;
}

Fixed version (ground truth):
/** 
 * Searches for an entry in the CalendarAlerts table that matches the given event id, begin time and alarm time.  If one is found then this alarm already exists and this method returns true.
 * @param cr the ContentResolver
 * @param eventId the event id to match
 * @param begin the start time of the event in UTC millis
 * @param alarmTime the alarm time of the event in UTC millis
 * @return true if there is already an alarm for the given eventwith the same start time and alarm time.
 */
public static final boolean alarmExists(ContentResolver cr,long eventId,long begin,long alarmTime){
  String[] projection=new String[]{ALARM_TIME};
  Cursor cursor=query(cr,projection,WHERE_ALARM_EXISTS,new String[]{Long.toString(eventId),Long.toString(begin),Long.toString(alarmTime)},null);
  boolean found=false;
  try {
    if (cursor != null && cursor.getCount() > 0) {
      found=true;
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return found;
}
Program: 182347
Project: 182347
Buggy source:
/** 
 * Finds the next alarm after (or equal to) the given time and returns the time of that alarm or -1 if no such alarm exists.
 * @param cr the ContentResolver
 * @param millis the time in UTC milliseconds
 * @return the next alarm time greater than or equal to "millis", or -1if no such alarm exists.
 */
public static final long findNextAlarmTime(ContentResolver cr,long millis){
  String selection=ALARM_TIME + "String_Node_Str" + millis;
  String[] projection=new String[]{ALARM_TIME};
  Cursor cursor=query(cr,projection,selection,null,ALARM_TIME + "String_Node_Str");
  long alarmTime=-1;
  try {
    if (cursor != null && cursor.moveToFirst()) {
      alarmTime=cursor.getLong(0);
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return alarmTime;
}

Fixed version (ground truth):
/** 
 * Finds the next alarm after (or equal to) the given time and returns the time of that alarm or -1 if no such alarm exists.
 * @param cr the ContentResolver
 * @param millis the time in UTC milliseconds
 * @return the next alarm time greater than or equal to "millis", or -1if no such alarm exists.
 */
public static final long findNextAlarmTime(ContentResolver cr,long millis){
  String selection=ALARM_TIME + "String_Node_Str" + millis;
  String[] projection=new String[]{ALARM_TIME};
  Cursor cursor=query(cr,projection,WHERE_FINDNEXTALARMTIME,new String[]{Long.toString(millis)},SORT_ORDER_ALARMTIME_ASC);
  long alarmTime=-1;
  try {
    if (cursor != null && cursor.moveToFirst()) {
      alarmTime=cursor.getLong(0);
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return alarmTime;
}
Program: 182348
Project: 182348
Buggy source:
public static void scheduleAlarm(Context context,AlarmManager manager,long alarmTime){
  if (DEBUG) {
    Time time=new Time();
    time.set(alarmTime);
    String schedTime=time.format("String_Node_Str");
    Log.d(TAG,"String_Node_Str" + alarmTime + "String_Node_Str"+ schedTime);
  }
  if (manager == null) {
    manager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  }
  Intent intent=new Intent(android.provider.Calendar.EVENT_REMINDER_ACTION);
  intent.putExtra(android.provider.Calendar.CalendarAlerts.ALARM_TIME,alarmTime);
  PendingIntent pi=PendingIntent.getBroadcast(context,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
  manager.set(AlarmManager.RTC_WAKEUP,alarmTime,pi);
}

Fixed version (ground truth):
public static void scheduleAlarm(Context context,AlarmManager manager,long alarmTime){
  if (DEBUG) {
    Time time=new Time();
    time.set(alarmTime);
    String schedTime=time.format("String_Node_Str");
    Log.d(TAG,"String_Node_Str" + alarmTime + "String_Node_Str"+ schedTime);
  }
  if (manager == null) {
    manager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  }
  Intent intent=new Intent(EVENT_REMINDER_ACTION);
  intent.putExtra(ALARM_TIME,alarmTime);
  PendingIntent pi=PendingIntent.getBroadcast(context,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
  manager.set(AlarmManager.RTC_WAKEUP,alarmTime,pi);
}
Program: 182349
Project: 182349
Buggy source:
/** 
 * Convenience method to delete all calendars that match the account.
 * @param cr the ContentResolver
 * @param account the account whose rows should be deleted
 * @return the count of rows that were deleted
 */
public static int deleteCalendarsForAccount(ContentResolver cr,Account account){
  return Calendar.Calendars.delete(cr,Calendar.Calendars._SYNC_ACCOUNT + "String_Node_Str" + Calendar.Calendars._SYNC_ACCOUNT_TYPE+ "String_Node_Str",new String[]{account.name,account.type});
}

Fixed version (ground truth):
/** 
 * Convenience method to delete all calendars that match the account.
 * @param cr the ContentResolver
 * @param account the account whose rows should be deleted
 * @return the count of rows that were deleted
 */
public static int deleteCalendarsForAccount(ContentResolver cr,Account account){
  return Calendar.Calendars.delete(cr,WHERE_DELETE_FOR_ACCOUNT,new String[]{account.name,account.type});
}