nus-yam/ex-repair huggingface dataset:
Program: 182483
Project: 182483
Buggy source:
public StopwatchTimer getWakeTimerLocked(String name,int type){
  Wakelock wl=mWakelockStats.get(name);
  if (wl == null) {
    wl=new Wakelock();
    mWakelockStats.put(name,wl);
  }
  StopwatchTimer t=null;
switch (type) {
case WAKE_TYPE_PARTIAL:
    t=wl.mTimerPartial;
  if (t == null) {
    t=new StopwatchTimer(WAKE_TYPE_PARTIAL,mPartialTimers,mUnpluggables);
    wl.mTimerPartial=t;
  }
return t;
case WAKE_TYPE_FULL:
t=wl.mTimerFull;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_FULL,mFullTimers,mUnpluggables);
wl.mTimerFull=t;
}
return t;
case WAKE_TYPE_WINDOW:
t=wl.mTimerWindow;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_WINDOW,mWindowTimers,mUnpluggables);
wl.mTimerWindow=t;
}
return t;
default :
throw new IllegalArgumentException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
public StopwatchTimer getWakeTimerLocked(String name,int type){
  Wakelock wl=mWakelockStats.get(name);
  if (wl == null) {
    if (mWakelockStats.size() > MAX_WAKELOCKS_PER_UID) {
      name=BATCHED_WAKELOCK_NAME;
      wl=mWakelockStats.get(name);
    }
    if (wl == null) {
      wl=new Wakelock();
      mWakelockStats.put(name,wl);
    }
  }
  StopwatchTimer t=null;
switch (type) {
case WAKE_TYPE_PARTIAL:
    t=wl.mTimerPartial;
  if (t == null) {
    t=new StopwatchTimer(WAKE_TYPE_PARTIAL,mPartialTimers,mUnpluggables);
    wl.mTimerPartial=t;
  }
return t;
case WAKE_TYPE_FULL:
t=wl.mTimerFull;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_FULL,mFullTimers,mUnpluggables);
wl.mTimerFull=t;
}
return t;
case WAKE_TYPE_WINDOW:
t=wl.mTimerWindow;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_WINDOW,mWindowTimers,mUnpluggables);
wl.mTimerWindow=t;
}
return t;
default :
throw new IllegalArgumentException("String_Node_Str" + type);
}
}
Program: 182485
Project: 182485
Buggy source:
private void removePackageDataLI(PackageParser.Package p,PackageRemovedInfo outInfo,int flags){
  String packageName=p.packageName;
  if (outInfo != null) {
    outInfo.removedPackage=packageName;
  }
  removePackageLI(p,true);
  PackageSetting deletedPs;
synchronized (mPackages) {
    deletedPs=mSettings.mPackages.get(packageName);
  }
  if ((flags & PackageManager.DONT_DELETE_DATA) == 0) {
    boolean useEncryptedFSDir=useEncryptedFilesystemForPackage(p);
    if (mInstaller != null) {
      int retCode=mInstaller.remove(packageName,useEncryptedFSDir);
      if (retCode < 0) {
        Log.w(TAG,"String_Node_Str" + packageName + "String_Node_Str"+ retCode);
      }
    }
 else {
      PackageParser.Package pkg=mPackages.get(packageName);
      File dataDir=new File(pkg.applicationInfo.dataDir);
      dataDir.delete();
    }
    schedulePackageCleaning(packageName);
synchronized (mPackages) {
      if (outInfo != null) {
        outInfo.removedUid=mSettings.removePackageLP(packageName);
      }
    }
  }
synchronized (mPackages) {
    if ((deletedPs != null) && (deletedPs.sharedUser != null)) {
      mSettings.updateSharedUserPermsLP(deletedPs,mGlobalGids);
    }
    mSettings.writeLP();
  }
}

Fixed version (ground truth):
private void removePackageDataLI(PackageParser.Package p,PackageRemovedInfo outInfo,int flags){
  String packageName=p.packageName;
  if (outInfo != null) {
    outInfo.removedPackage=packageName;
  }
  removePackageLI(p,true);
  PackageSetting deletedPs;
synchronized (mPackages) {
    deletedPs=mSettings.mPackages.get(packageName);
  }
  if ((flags & PackageManager.DONT_DELETE_DATA) == 0) {
    boolean useEncryptedFSDir=useEncryptedFilesystemForPackage(p);
    if (mInstaller != null) {
      int retCode=mInstaller.remove(packageName,useEncryptedFSDir);
      if (retCode < 0) {
        Log.w(TAG,"String_Node_Str" + packageName + "String_Node_Str"+ retCode);
      }
    }
 else {
      PackageParser.Package pkg=mPackages.get(packageName);
      File dataDir=new File(pkg.applicationInfo.dataDir);
      dataDir.delete();
    }
    schedulePackageCleaning(packageName);
synchronized (mPackages) {
      if (outInfo != null) {
        outInfo.removedUid=mSettings.removePackageLP(packageName);
      }
    }
  }
synchronized (mPackages) {
    if ((deletedPs != null) && (deletedPs.sharedUser != null)) {
      mSettings.updateSharedUserPermsLP(deletedPs,mGlobalGids);
    }
    if (deletedPs != null) {
      ArrayList<PreferredActivity> removed=new ArrayList<PreferredActivity>();
      for (      PreferredActivity pa : mSettings.mPreferredActivities.filterSet()) {
        if (pa.mActivity.getPackageName().equals(deletedPs.name)) {
          removed.add(pa);
        }
      }
      for (      PreferredActivity pa : removed) {
        mSettings.mPreferredActivities.removeFilter(pa);
      }
    }
    mSettings.writeLP();
  }
}
Program: 182487
Project: 182487
Buggy source:
private void removeUriPermissionIfNeededLocked(UriPermission perm){
  if ((perm.modeFlags & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION)) == 0) {
    HashMap<Uri,UriPermission> perms=mGrantedUriPermissions.get(perm.uid);
    if (perms != null) {
      perms.remove(perm.uri);
      if (perms.size() == 0) {
        mGrantedUriPermissions.remove(perm.uid);
      }
    }
  }
}

Fixed version (ground truth):
private void removeUriPermissionIfNeededLocked(UriPermission perm){
  if ((perm.modeFlags & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION)) == 0) {
    HashMap<Uri,UriPermission> perms=mGrantedUriPermissions.get(perm.uid);
    if (perms != null) {
      if (DEBUG_URI_PERMISSION)       Log.v(TAG,"String_Node_Str" + perm.uid + "String_Node_Str"+ perm.uri);
      perms.remove(perm.uri);
      if (perms.size() == 0) {
        mGrantedUriPermissions.remove(perm.uid);
      }
    }
  }
}
Program: 182489
Project: 182489
Buggy source:
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,-1,-1,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    int callingPid;
    int callingUid;
    if (caller == null) {
      callingPid=Binder.getCallingPid();
      callingUid=Binder.getCallingUid();
    }
 else {
      callingPid=callingUid=-1;
    }
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,callingPid,callingUid,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 182490
Project: 182490
Buggy source:
protected void finalize() throws Throwable {
  if (!canceled) {
synchronized (owner) {
      WeakReference<PendingIntentRecord> current=owner.mIntentSenderRecords.get(key);
      if (current == ref) {
        owner.mIntentSenderRecords.remove(key);
      }
    }
  }
}

Fixed version (ground truth):
protected void finalize() throws Throwable {
  try {
    if (!canceled) {
      owner.mHandler.sendMessage(owner.mHandler.obtainMessage(ActivityManagerService.FINALIZE_PENDING_INTENT_MSG,this));
    }
  }
  finally {
    super.finalize();
  }
}
Program: 182491
Project: 182491
Buggy source:
public void postNotification(){
  if (foregroundId != 0 && foregroundNoti != null) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    final Notification localForegroundNoti=foregroundNoti;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          int[] outId=new int[1];
          inm.enqueueNotification(localPackageName,localForegroundId,localForegroundNoti,outId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void postNotification(){
  if (foregroundId != 0 && foregroundNoti != null) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    final Notification localForegroundNoti=foregroundNoti;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          int[] outId=new int[1];
          inm.enqueueNotification(localPackageName,localForegroundId,localForegroundNoti,outId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
          ams.setServiceForeground(name,ServiceRecord.this,localForegroundId,null,true);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}
Program: 182492
Project: 182492
Buggy source:
public void cancelNotification(){
  if (foregroundId != 0) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          inm.cancelNotification(localPackageName,localForegroundId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str" + "String_Node_Str",e);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void cancelNotification(){
  if (foregroundId != 0) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          inm.cancelNotification(localPackageName,localForegroundId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}
Program: 182493
Project: 182493
Buggy source:
public void run(){
  INotificationManager inm=NotificationManager.getService();
  if (inm == null) {
    return;
  }
  try {
    inm.cancelNotification(localPackageName,localForegroundId);
  }
 catch (  RuntimeException e) {
    Log.w(ActivityManagerService.TAG,"String_Node_Str" + "String_Node_Str",e);
  }
catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
public void run(){
  INotificationManager inm=NotificationManager.getService();
  if (inm == null) {
    return;
  }
  try {
    inm.cancelNotification(localPackageName,localForegroundId);
  }
 catch (  RuntimeException e) {
    Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
  }
catch (  RemoteException e) {
  }
}
Program: 182497
Project: 182497
Buggy source:
private String getTestPath(){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  String test_path=LAYOUT_TESTS_ROOT;
  if (runner.mTestPath != null) {
    test_path+=runner.mTestPath;
  }
  try {
    test_path=new File(test_path).getCanonicalPath();
  }
 catch (  IOException e) {
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  Log.v("String_Node_Str","String_Node_Str" + test_path);
  return test_path;
}

Fixed version (ground truth):
private String getTestPath(){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  String test_path=LAYOUT_TESTS_ROOT;
  if (runner.mTestPath != null) {
    test_path+=runner.mTestPath;
  }
  test_path=new File(test_path).getAbsolutePath();
  Log.v("String_Node_Str","String_Node_Str" + test_path);
  return test_path;
}
Program: 182498
Project: 182498
Buggy source:
public void executeLayoutTests(boolean resume){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  if (runner.mTestPath == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  this.mTestList=new Vector<String>();
  try {
    this.mTestPathPrefix=(new File(LAYOUT_TESTS_ROOT + runner.mTestPath)).getCanonicalPath();
  }
 catch (  IOException e) {
    Log.e(LOGTAG,"String_Node_Str" + e.getMessage());
    return;
  }
  this.mRebaselineResults=runner.mRebaseline;
  int timeout=runner.mTimeoutInMillis;
  if (timeout <= 0) {
    timeout=DEFAULT_TIMEOUT_IN_MILLIS;
  }
  this.mResultRecorder=new MyTestRecorder(resume);
  if (!resume)   clearTestStatus();
  getTestList();
  if (resume)   resumeTestList();
  TestShellActivity activity=getActivity();
  activity.setDefaultDumpDataType(DumpDataType.DUMP_AS_TEXT);
  int addr=-1;
  try {
    addr=AdbUtils.resolve("String_Node_Str");
  }
 catch (  IOException ioe) {
    Log.w(LOGTAG,"String_Node_Str",ioe);
  }
  if (addr == -1) {
    Log.w(LOGTAG,"String_Node_Str");
  }
  for (int i=0; i < mTestList.size(); i++) {
    String s=mTestList.elementAt(i);
    FsUtils.updateTestStatus(TEST_STATUS_FILE,s);
    runTestAndWaitUntilDone(activity,s,runner.mTimeoutInMillis);
  }
  FsUtils.updateTestStatus(TEST_STATUS_FILE,"String_Node_Str");
  ForwardService.getForwardService().stopForwardService();
  activity.finish();
}

Fixed version (ground truth):
public void executeLayoutTests(boolean resume){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  if (runner.mTestPath == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  this.mTestList=new Vector<String>();
  this.mTestPathPrefix=(new File(LAYOUT_TESTS_ROOT + runner.mTestPath)).getAbsolutePath();
  this.mRebaselineResults=runner.mRebaseline;
  int timeout=runner.mTimeoutInMillis;
  if (timeout <= 0) {
    timeout=DEFAULT_TIMEOUT_IN_MILLIS;
  }
  this.mResultRecorder=new MyTestRecorder(resume);
  if (!resume)   clearTestStatus();
  getTestList();
  if (resume)   resumeTestList();
  TestShellActivity activity=getActivity();
  activity.setDefaultDumpDataType(DumpDataType.DUMP_AS_TEXT);
  int addr=-1;
  try {
    addr=AdbUtils.resolve("String_Node_Str");
  }
 catch (  IOException ioe) {
    Log.w(LOGTAG,"String_Node_Str",ioe);
  }
  if (addr == -1) {
    Log.w(LOGTAG,"String_Node_Str");
  }
  for (int i=0; i < mTestList.size(); i++) {
    String s=mTestList.elementAt(i);
    FsUtils.updateTestStatus(TEST_STATUS_FILE,s);
    runTestAndWaitUntilDone(activity,s,runner.mTimeoutInMillis);
  }
  FsUtils.updateTestStatus(TEST_STATUS_FILE,"String_Node_Str");
  ForwardService.getForwardService().stopForwardService();
  activity.finish();
}
Program: 182500
Project: 182500
Buggy source:
public boolean onKeyDown(int keyCode,KeyEvent event){
  if (mScrollView != null && mScrollView.executeKeyEvent(event))   return true;
  return false;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public boolean onKeyDown(int keyCode,KeyEvent event){
  return mScrollView != null && mScrollView.executeKeyEvent(event);
}
Program: 182502
Project: 182502
Buggy source:
public Button getButton(int whichButton){
switch (whichButton) {
case DialogInterface.BUTTON_POSITIVE:
    return mButtonPositiveMessage != null ? mButtonPositive : null;
case DialogInterface.BUTTON_NEGATIVE:
  return mButtonNegativeMessage != null ? mButtonNegative : null;
case DialogInterface.BUTTON_NEUTRAL:
return mButtonNeutralMessage != null ? mButtonNeutral : null;
default :
return null;
}
}

Fixed version (ground truth):
public Button getButton(int whichButton){
switch (whichButton) {
case DialogInterface.BUTTON_POSITIVE:
    return mButtonPositive;
case DialogInterface.BUTTON_NEGATIVE:
  return mButtonNegative;
case DialogInterface.BUTTON_NEUTRAL:
return mButtonNeutral;
default :
return null;
}
}
Program: 182503
Project: 182503
Buggy source:
public boolean onKeyUp(int keyCode,KeyEvent event){
  if (mScrollView != null && mScrollView.executeKeyEvent(event))   return true;
  return false;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public boolean onKeyUp(int keyCode,KeyEvent event){
  return mScrollView != null && mScrollView.executeKeyEvent(event);
}
Program: 182505
Project: 182505
Buggy source:
private String getTestPath(){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  String test_path=LAYOUT_TESTS_ROOT;
  if (runner.mTestPath != null) {
    test_path+=runner.mTestPath;
  }
  try {
    test_path=new File(test_path).getCanonicalPath();
  }
 catch (  IOException e) {
    Log.e("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  Log.v("String_Node_Str","String_Node_Str" + test_path);
  return test_path;
}

Fixed version (ground truth):
private String getTestPath(){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  String test_path=LAYOUT_TESTS_ROOT;
  if (runner.mTestPath != null) {
    test_path+=runner.mTestPath;
  }
  test_path=new File(test_path).getAbsolutePath();
  Log.v("String_Node_Str","String_Node_Str" + test_path);
  return test_path;
}
Program: 182506
Project: 182506
Buggy source:
public void executeLayoutTests(boolean resume){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  if (runner.mTestPath == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  this.mTestList=new Vector<String>();
  try {
    this.mTestPathPrefix=(new File(LAYOUT_TESTS_ROOT + runner.mTestPath)).getCanonicalPath();
  }
 catch (  IOException e) {
    Log.e(LOGTAG,"String_Node_Str" + e.getMessage());
    return;
  }
  this.mRebaselineResults=runner.mRebaseline;
  int timeout=runner.mTimeoutInMillis;
  if (timeout <= 0) {
    timeout=DEFAULT_TIMEOUT_IN_MILLIS;
  }
  this.mResultRecorder=new MyTestRecorder(resume);
  if (!resume)   clearTestStatus();
  getTestList();
  if (resume)   resumeTestList();
  TestShellActivity activity=getActivity();
  activity.setDefaultDumpDataType(DumpDataType.DUMP_AS_TEXT);
  int addr=-1;
  try {
    addr=AdbUtils.resolve("String_Node_Str");
  }
 catch (  IOException ioe) {
    Log.w(LOGTAG,"String_Node_Str",ioe);
  }
  if (addr == -1) {
    Log.w(LOGTAG,"String_Node_Str");
  }
  for (int i=0; i < mTestList.size(); i++) {
    String s=mTestList.elementAt(i);
    FsUtils.updateTestStatus(TEST_STATUS_FILE,s);
    runTestAndWaitUntilDone(activity,s,runner.mTimeoutInMillis);
  }
  FsUtils.updateTestStatus(TEST_STATUS_FILE,"String_Node_Str");
  ForwardService.getForwardService().stopForwardService();
  activity.finish();
}

Fixed version (ground truth):
public void executeLayoutTests(boolean resume){
  LayoutTestsAutoRunner runner=(LayoutTestsAutoRunner)getInstrumentation();
  if (runner.mTestPath == null) {
    Log.e(LOGTAG,"String_Node_Str");
    return;
  }
  this.mTestList=new Vector<String>();
  this.mTestPathPrefix=(new File(LAYOUT_TESTS_ROOT + runner.mTestPath)).getAbsolutePath();
  this.mRebaselineResults=runner.mRebaseline;
  int timeout=runner.mTimeoutInMillis;
  if (timeout <= 0) {
    timeout=DEFAULT_TIMEOUT_IN_MILLIS;
  }
  this.mResultRecorder=new MyTestRecorder(resume);
  if (!resume)   clearTestStatus();
  getTestList();
  if (resume)   resumeTestList();
  TestShellActivity activity=getActivity();
  activity.setDefaultDumpDataType(DumpDataType.DUMP_AS_TEXT);
  int addr=-1;
  try {
    addr=AdbUtils.resolve("String_Node_Str");
  }
 catch (  IOException ioe) {
    Log.w(LOGTAG,"String_Node_Str",ioe);
  }
  if (addr == -1) {
    Log.w(LOGTAG,"String_Node_Str");
  }
  for (int i=0; i < mTestList.size(); i++) {
    String s=mTestList.elementAt(i);
    FsUtils.updateTestStatus(TEST_STATUS_FILE,s);
    runTestAndWaitUntilDone(activity,s,runner.mTimeoutInMillis);
  }
  FsUtils.updateTestStatus(TEST_STATUS_FILE,"String_Node_Str");
  ForwardService.getForwardService().stopForwardService();
  activity.finish();
}
Program: 182507
Project: 182507
Buggy source:
private final void handleLaunchActivity(ActivityRecord r,Intent customIntent){
  unscheduleGcIdler();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  Activity a=performLaunchActivity(r,customIntent);
  if (a != null) {
    r.createdConfig=new Configuration(mConfiguration);
    handleResumeActivity(r.token,false,r.isForward);
    if (!r.activity.mFinished && r.startsNotResumed) {
      try {
        r.activity.mCalled=false;
        mInstrumentation.callActivityOnPause(r.activity);
        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;
    }
  }
 else {
    try {
      ActivityManagerNative.getDefault().finishActivity(r.token,Activity.RESULT_CANCELED,null);
    }
 catch (    RemoteException ex) {
    }
  }
}

Fixed version (ground truth):
private final void handleLaunchActivity(ActivityRecord r,Intent customIntent){
  unscheduleGcIdler();
  if (localLOGV)   Log.v(TAG,"String_Node_Str" + r);
  Activity a=performLaunchActivity(r,customIntent);
  if (a != null) {
    r.createdConfig=new Configuration(mConfiguration);
    Bundle oldState=r.state;
    handleResumeActivity(r.token,false,r.isForward);
    if (!r.activity.mFinished && r.startsNotResumed) {
      try {
        r.activity.mCalled=false;
        mInstrumentation.callActivityOnPause(r.activity);
        r.state=oldState;
        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;
    }
  }
 else {
    try {
      ActivityManagerNative.getDefault().finishActivity(r.token,Activity.RESULT_CANCELED,null);
    }
 catch (    RemoteException ex) {
    }
  }
}
Program: 182509
Project: 182509
Buggy source:
public StopwatchTimer getWakeTimerLocked(String name,int type){
  Wakelock wl=mWakelockStats.get(name);
  if (wl == null) {
    wl=new Wakelock();
    mWakelockStats.put(name,wl);
  }
  StopwatchTimer t=null;
switch (type) {
case WAKE_TYPE_PARTIAL:
    t=wl.mTimerPartial;
  if (t == null) {
    t=new StopwatchTimer(WAKE_TYPE_PARTIAL,mPartialTimers,mUnpluggables);
    wl.mTimerPartial=t;
  }
return t;
case WAKE_TYPE_FULL:
t=wl.mTimerFull;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_FULL,mFullTimers,mUnpluggables);
wl.mTimerFull=t;
}
return t;
case WAKE_TYPE_WINDOW:
t=wl.mTimerWindow;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_WINDOW,mWindowTimers,mUnpluggables);
wl.mTimerWindow=t;
}
return t;
default :
throw new IllegalArgumentException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
public StopwatchTimer getWakeTimerLocked(String name,int type){
  Wakelock wl=mWakelockStats.get(name);
  if (wl == null) {
    if (mWakelockStats.size() > MAX_WAKELOCKS_PER_UID) {
      name=BATCHED_WAKELOCK_NAME;
      wl=mWakelockStats.get(name);
    }
    if (wl == null) {
      wl=new Wakelock();
      mWakelockStats.put(name,wl);
    }
  }
  StopwatchTimer t=null;
switch (type) {
case WAKE_TYPE_PARTIAL:
    t=wl.mTimerPartial;
  if (t == null) {
    t=new StopwatchTimer(WAKE_TYPE_PARTIAL,mPartialTimers,mUnpluggables);
    wl.mTimerPartial=t;
  }
return t;
case WAKE_TYPE_FULL:
t=wl.mTimerFull;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_FULL,mFullTimers,mUnpluggables);
wl.mTimerFull=t;
}
return t;
case WAKE_TYPE_WINDOW:
t=wl.mTimerWindow;
if (t == null) {
t=new StopwatchTimer(WAKE_TYPE_WINDOW,mWindowTimers,mUnpluggables);
wl.mTimerWindow=t;
}
return t;
default :
throw new IllegalArgumentException("String_Node_Str" + type);
}
}
Program: 182511
Project: 182511
Buggy source:
private void removePackageDataLI(PackageParser.Package p,PackageRemovedInfo outInfo,int flags){
  String packageName=p.packageName;
  if (outInfo != null) {
    outInfo.removedPackage=packageName;
  }
  removePackageLI(p,true);
  PackageSetting deletedPs;
synchronized (mPackages) {
    deletedPs=mSettings.mPackages.get(packageName);
  }
  if ((flags & PackageManager.DONT_DELETE_DATA) == 0) {
    boolean useEncryptedFSDir=useEncryptedFilesystemForPackage(p);
    if (mInstaller != null) {
      int retCode=mInstaller.remove(packageName,useEncryptedFSDir);
      if (retCode < 0) {
        Log.w(TAG,"String_Node_Str" + packageName + "String_Node_Str"+ retCode);
      }
    }
 else {
      PackageParser.Package pkg=mPackages.get(packageName);
      File dataDir=new File(pkg.applicationInfo.dataDir);
      dataDir.delete();
    }
    schedulePackageCleaning(packageName);
synchronized (mPackages) {
      if (outInfo != null) {
        outInfo.removedUid=mSettings.removePackageLP(packageName);
      }
    }
  }
synchronized (mPackages) {
    if ((deletedPs != null) && (deletedPs.sharedUser != null)) {
      mSettings.updateSharedUserPermsLP(deletedPs,mGlobalGids);
    }
    mSettings.writeLP();
  }
}

Fixed version (ground truth):
private void removePackageDataLI(PackageParser.Package p,PackageRemovedInfo outInfo,int flags){
  String packageName=p.packageName;
  if (outInfo != null) {
    outInfo.removedPackage=packageName;
  }
  removePackageLI(p,true);
  PackageSetting deletedPs;
synchronized (mPackages) {
    deletedPs=mSettings.mPackages.get(packageName);
  }
  if ((flags & PackageManager.DONT_DELETE_DATA) == 0) {
    boolean useEncryptedFSDir=useEncryptedFilesystemForPackage(p);
    if (mInstaller != null) {
      int retCode=mInstaller.remove(packageName,useEncryptedFSDir);
      if (retCode < 0) {
        Log.w(TAG,"String_Node_Str" + packageName + "String_Node_Str"+ retCode);
      }
    }
 else {
      PackageParser.Package pkg=mPackages.get(packageName);
      File dataDir=new File(pkg.applicationInfo.dataDir);
      dataDir.delete();
    }
    schedulePackageCleaning(packageName);
synchronized (mPackages) {
      if (outInfo != null) {
        outInfo.removedUid=mSettings.removePackageLP(packageName);
      }
    }
  }
synchronized (mPackages) {
    if ((deletedPs != null) && (deletedPs.sharedUser != null)) {
      mSettings.updateSharedUserPermsLP(deletedPs,mGlobalGids);
    }
    if (deletedPs != null) {
      ArrayList<PreferredActivity> removed=new ArrayList<PreferredActivity>();
      for (      PreferredActivity pa : mSettings.mPreferredActivities.filterSet()) {
        if (pa.mActivity.getPackageName().equals(deletedPs.name)) {
          removed.add(pa);
        }
      }
      for (      PreferredActivity pa : removed) {
        mSettings.mPreferredActivities.removeFilter(pa);
      }
    }
    mSettings.writeLP();
  }
}
Program: 182513
Project: 182513
Buggy source:
private void removeUriPermissionIfNeededLocked(UriPermission perm){
  if ((perm.modeFlags & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION)) == 0) {
    HashMap<Uri,UriPermission> perms=mGrantedUriPermissions.get(perm.uid);
    if (perms != null) {
      perms.remove(perm.uri);
      if (perms.size() == 0) {
        mGrantedUriPermissions.remove(perm.uid);
      }
    }
  }
}

Fixed version (ground truth):
private void removeUriPermissionIfNeededLocked(UriPermission perm){
  if ((perm.modeFlags & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION)) == 0) {
    HashMap<Uri,UriPermission> perms=mGrantedUriPermissions.get(perm.uid);
    if (perms != null) {
      if (DEBUG_URI_PERMISSION)       Log.v(TAG,"String_Node_Str" + perm.uid + "String_Node_Str"+ perm.uri);
      perms.remove(perm.uri);
      if (perms.size() == 0) {
        mGrantedUriPermissions.remove(perm.uid);
      }
    }
  }
}
Program: 182515
Project: 182515
Buggy source:
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,-1,-1,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}

Fixed version (ground truth):
public final int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug){
  if (intent != null && intent.hasFileDescriptors()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final boolean componentSpecified=intent.getComponent() != null;
  intent=new Intent(intent);
  ActivityInfo aInfo;
  try {
    ResolveInfo rInfo=ActivityThread.getPackageManager().resolveIntent(intent,resolvedType,PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS);
    aInfo=rInfo != null ? rInfo.activityInfo : null;
  }
 catch (  RemoteException e) {
    aInfo=null;
  }
  if (aInfo != null) {
    intent.setComponent(new ComponentName(aInfo.applicationInfo.packageName,aInfo.name));
    if (debug) {
      if (!aInfo.processName.equals("String_Node_Str")) {
        setDebugApp(aInfo.processName,true,false);
      }
    }
  }
synchronized (this) {
    int callingPid;
    int callingUid;
    if (caller == null) {
      callingPid=Binder.getCallingPid();
      callingUid=Binder.getCallingUid();
    }
 else {
      callingPid=callingUid=-1;
    }
    final long origId=Binder.clearCallingIdentity();
    int res=startActivityLocked(caller,intent,resolvedType,grantedUriPermissions,grantedMode,aInfo,resultTo,resultWho,requestCode,callingPid,callingUid,onlyIfNeeded,componentSpecified);
    Binder.restoreCallingIdentity(origId);
    return res;
  }
}
Program: 182516
Project: 182516
Buggy source:
protected void finalize() throws Throwable {
  if (!canceled) {
synchronized (owner) {
      WeakReference<PendingIntentRecord> current=owner.mIntentSenderRecords.get(key);
      if (current == ref) {
        owner.mIntentSenderRecords.remove(key);
      }
    }
  }
}

Fixed version (ground truth):
protected void finalize() throws Throwable {
  try {
    if (!canceled) {
      owner.mHandler.sendMessage(owner.mHandler.obtainMessage(ActivityManagerService.FINALIZE_PENDING_INTENT_MSG,this));
    }
  }
  finally {
    super.finalize();
  }
}
Program: 182517
Project: 182517
Buggy source:
public void postNotification(){
  if (foregroundId != 0 && foregroundNoti != null) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    final Notification localForegroundNoti=foregroundNoti;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          int[] outId=new int[1];
          inm.enqueueNotification(localPackageName,localForegroundId,localForegroundNoti,outId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void postNotification(){
  if (foregroundId != 0 && foregroundNoti != null) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    final Notification localForegroundNoti=foregroundNoti;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          int[] outId=new int[1];
          inm.enqueueNotification(localPackageName,localForegroundId,localForegroundNoti,outId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
          ams.setServiceForeground(name,ServiceRecord.this,localForegroundId,null,true);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}
Program: 182518
Project: 182518
Buggy source:
public void cancelNotification(){
  if (foregroundId != 0) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          inm.cancelNotification(localPackageName,localForegroundId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str" + "String_Node_Str",e);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public void cancelNotification(){
  if (foregroundId != 0) {
    final String localPackageName=packageName;
    final int localForegroundId=foregroundId;
    ams.mHandler.post(new Runnable(){
      public void run(){
        INotificationManager inm=NotificationManager.getService();
        if (inm == null) {
          return;
        }
        try {
          inm.cancelNotification(localPackageName,localForegroundId);
        }
 catch (        RuntimeException e) {
          Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
        }
catch (        RemoteException e) {
        }
      }
    }
);
  }
}
Program: 182519
Project: 182519
Buggy source:
public void run(){
  INotificationManager inm=NotificationManager.getService();
  if (inm == null) {
    return;
  }
  try {
    inm.cancelNotification(localPackageName,localForegroundId);
  }
 catch (  RuntimeException e) {
    Log.w(ActivityManagerService.TAG,"String_Node_Str" + "String_Node_Str",e);
  }
catch (  RemoteException e) {
  }
}

Fixed version (ground truth):
public void run(){
  INotificationManager inm=NotificationManager.getService();
  if (inm == null) {
    return;
  }
  try {
    inm.cancelNotification(localPackageName,localForegroundId);
  }
 catch (  RuntimeException e) {
    Log.w(ActivityManagerService.TAG,"String_Node_Str",e);
  }
catch (  RemoteException e) {
  }
}
Program: 182521
Project: 182521
Buggy source:
final void performRestart(){
  final int N=mManagedCursors.size();
  for (int i=0; i < N; i++) {
    ManagedCursor mc=mManagedCursors.get(i);
    if (mc.mReleased || mc.mUpdated) {
      mc.mCursor.requery();
      mc.mReleased=false;
      mc.mUpdated=false;
    }
  }
  if (mStopped) {
    mStopped=false;
    mCalled=false;
    mInstrumentation.callActivityOnRestart(this);
    if (!mCalled) {
      throw new SuperNotCalledException("String_Node_Str" + mComponent.toShortString() + "String_Node_Str");
    }
    performStart();
  }
}

Fixed version (ground truth):
final void performRestart(){
synchronized (mManagedCursors) {
    final int N=mManagedCursors.size();
    for (int i=0; i < N; i++) {
      ManagedCursor mc=mManagedCursors.get(i);
      if (mc.mReleased || mc.mUpdated) {
        mc.mCursor.requery();
        mc.mReleased=false;
        mc.mUpdated=false;
      }
    }
  }
  if (mStopped) {
    mStopped=false;
    mCalled=false;
    mInstrumentation.callActivityOnRestart(this);
    if (!mCalled) {
      throw new SuperNotCalledException("String_Node_Str" + mComponent.toShortString() + "String_Node_Str");
    }
    performStart();
  }
}
Program: 182522
Project: 182522
Buggy source:
final void performStop(){
  if (!mStopped) {
    if (mWindow != null) {
      mWindow.closeAllPanels();
    }
    mCalled=false;
    mInstrumentation.callActivityOnStop(this);
    if (!mCalled) {
      throw new SuperNotCalledException("String_Node_Str" + mComponent.toShortString() + "String_Node_Str");
    }
    final int N=mManagedCursors.size();
    for (int i=0; i < N; i++) {
      ManagedCursor mc=mManagedCursors.get(i);
      if (!mc.mReleased) {
        mc.mCursor.deactivate();
        mc.mReleased=true;
      }
    }
    mStopped=true;
  }
  mResumed=false;
}

Fixed version (ground truth):
final void performStop(){
  if (!mStopped) {
    if (mWindow != null) {
      mWindow.closeAllPanels();
    }
    mCalled=false;
    mInstrumentation.callActivityOnStop(this);
    if (!mCalled) {
      throw new SuperNotCalledException("String_Node_Str" + mComponent.toShortString() + "String_Node_Str");
    }
synchronized (mManagedCursors) {
      final int N=mManagedCursors.size();
      for (int i=0; i < N; i++) {
        ManagedCursor mc=mManagedCursors.get(i);
        if (!mc.mReleased) {
          mc.mCursor.deactivate();
          mc.mReleased=true;
        }
      }
    }
    mStopped=true;
  }
  mResumed=false;
}
Program: 182523
Project: 182523
Buggy source:
public boolean onKeyDown(int keyCode,KeyEvent event){
  if (mScrollView != null && mScrollView.executeKeyEvent(event))   return true;
  return false;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public boolean onKeyDown(int keyCode,KeyEvent event){
  return mScrollView != null && mScrollView.executeKeyEvent(event);
}
Program: 182525
Project: 182525
Buggy source:
public Button getButton(int whichButton){
switch (whichButton) {
case DialogInterface.BUTTON_POSITIVE:
    return mButtonPositiveMessage != null ? mButtonPositive : null;
case DialogInterface.BUTTON_NEGATIVE:
  return mButtonNegativeMessage != null ? mButtonNegative : null;
case DialogInterface.BUTTON_NEUTRAL:
return mButtonNeutralMessage != null ? mButtonNeutral : null;
default :
return null;
}
}

Fixed version (ground truth):
public Button getButton(int whichButton){
switch (whichButton) {
case DialogInterface.BUTTON_POSITIVE:
    return mButtonPositive;
case DialogInterface.BUTTON_NEGATIVE:
  return mButtonNegative;
case DialogInterface.BUTTON_NEUTRAL:
return mButtonNeutral;
default :
return null;
}
}
Program: 182526
Project: 182526
Buggy source:
public boolean onKeyUp(int keyCode,KeyEvent event){
  if (mScrollView != null && mScrollView.executeKeyEvent(event))   return true;
  return false;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public boolean onKeyUp(int keyCode,KeyEvent event){
  return mScrollView != null && mScrollView.executeKeyEvent(event);
}
Program: 182529
Project: 182529
Buggy source:
/** 
 * Gets a value and converts it to a Float.
 * @param key the value to get
 * @return the Float value, or null if the value is missing or cannot be converted
 */
public Float getAsFloat(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).floatValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Float.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Float.
 * @param key the value to get
 * @return the Float value, or null if the value is missing or cannot be converted
 */
public Float getAsFloat(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).floatValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Float.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 182530
Project: 182530
Buggy source:
/** 
 * Gets a value and converts it to a Byte.
 * @param key the value to get
 * @return the Byte value, or null if the value is missing or cannot be converted
 */
public Byte getAsByte(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).byteValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Byte.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Byte.
 * @param key the value to get
 * @return the Byte value, or null if the value is missing or cannot be converted
 */
public Byte getAsByte(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).byteValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Byte.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 182531
Project: 182531
Buggy source:
/** 
 * Gets a value and converts it to an Integer.
 * @param key the value to get
 * @return the Integer value, or null if the value is missing or cannot be converted
 */
public Integer getAsInteger(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).intValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Integer.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to an Integer.
 * @param key the value to get
 * @return the Integer value, or null if the value is missing or cannot be converted
 */
public Integer getAsInteger(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).intValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Integer.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 182532
Project: 182532
Buggy source:
/** 
 * Gets a value and converts it to a Long.
 * @param key the value to get
 * @return the Long value, or null if the value is missing or cannot be converted
 */
public Long getAsLong(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).longValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Long.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str");
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Gets a value and converts it to a Long.
 * @param key the value to get
 * @return the Long value, or null if the value is missing or cannot be converted
 */
public Long getAsLong(String key){
  Object value=mValues.get(key);
  try {
    return value != null ? ((Number)value).longValue() : null;
  }
 catch (  ClassCastException e) {
    if (value instanceof CharSequence) {
      try {
        return Long.valueOf(value.toString());
      }
 catch (      NumberFormatException e2) {
        Log.e(TAG,"String_Node_Str" + value + "String_Node_Str"+ key);
        return null;
      }
    }
 else {
      Log.e(TAG,"String_Node_Str" + key + "String_Node_Str"+ value,e);
      return null;
    }
  }
}
Program: 182533
Project: 182533
Buggy source:
/** 
 * Returns true if this object has the named value.
 * @param key the value to check for
 * @return {@code true} if the value is present, {@code false} otherwise 
 */
public boolean containsKey(String key){
  return mValues.containsKey(key);
}

Fixed version (ground truth):
/** 
 * Returns true if this object has the named value.
 * @param key the value to check for
 * @return {@code true} if the value is present, {@code false} otherwise
 */
public boolean containsKey(String key){
  return mValues.containsKey(key);
}