nus-yam/ex-repair huggingface dataset:
Program: 42436
Project: 42436
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: 42438
Project: 42438
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: 42440
Project: 42440
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: 42442
Project: 42442
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: 42444
Project: 42444
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: 42445
Project: 42445
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: 42446
Project: 42446
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: 42447
Project: 42447
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: 42448
Project: 42448
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: 42449
Project: 42449
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: 42450
Project: 42450
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: 42452
Project: 42452
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: 42453
Project: 42453
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: 42455
Project: 42455
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: 42457
Project: 42457
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: 42459
Project: 42459
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: 42461
Project: 42461
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: 42463
Project: 42463
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: 42464
Project: 42464
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: 42465
Project: 42465
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: 42466
Project: 42466
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: 42467
Project: 42467
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: 42469
Project: 42469
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: 42470
Project: 42470
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: 42471
Project: 42471
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: 42473
Project: 42473
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: 42474
Project: 42474
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: 42476
Project: 42476
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: 42478
Project: 42478
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: 42479
Project: 42479
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: 42481
Project: 42481
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: 42482
Project: 42482
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: 42483
Project: 42483
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;
    }
  }
}