nus-yam/ex-repair huggingface dataset:
Program: 23025
Project: 23025
Buggy source:
void dump(PrintWriter pw,String prefix){
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.print(uid);
  pw.print("String_Node_Str");
  pw.print(key.packageName);
  pw.print("String_Node_Str");
  pw.print(key.typeName());
  pw.print("String_Node_Str");
  pw.println(Integer.toHexString(key.flags));
  if (key.activity != null || key.who != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.activity);
    pw.print("String_Node_Str");
    pw.println(key.who);
  }
  if (key.requestCode != 0 || key.requestResolvedType != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.requestCode);
    pw.print("String_Node_Str");
    pw.println(key.requestResolvedType);
  }
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.println(key.requestIntent.toShortString(true,true));
  if (sent || canceled) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(sent);
    pw.print("String_Node_Str");
    pw.println(canceled);
  }
}

Fixed version (ground truth):
void dump(PrintWriter pw,String prefix){
  pw.print(prefix);
  pw.print("String_Node_Str");
  pw.print(uid);
  pw.print("String_Node_Str");
  pw.print(key.packageName);
  pw.print("String_Node_Str");
  pw.print(key.typeName());
  pw.print("String_Node_Str");
  pw.println(Integer.toHexString(key.flags));
  if (key.activity != null || key.who != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.activity);
    pw.print("String_Node_Str");
    pw.println(key.who);
  }
  if (key.requestCode != 0 || key.requestResolvedType != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(key.requestCode);
    pw.print("String_Node_Str");
    pw.println(key.requestResolvedType);
  }
  if (key.requestIntent != null) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.println(key.requestIntent.toShortString(true,true));
  }
  if (sent || canceled) {
    pw.print(prefix);
    pw.print("String_Node_Str");
    pw.print(sent);
    pw.print("String_Node_Str");
    pw.println(canceled);
  }
}
Program: 23026
Project: 23026
Buggy source:
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}

Fixed version (ground truth):
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId) || mAsecMountSet.contains(newId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}
Program: 23027
Project: 23027
Buggy source:
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}

Fixed version (ground truth):
public int renameSecureContainer(String oldId,String newId){
  validatePermission(android.Manifest.permission.ASEC_RENAME);
  waitForReady();
  warnOnNotMounted();
synchronized (mAsecMountSet) {
    if (mAsecMountSet.contains(oldId) || mAsecMountSet.contains(newId)) {
      return StorageResultCode.OperationFailedStorageMounted;
    }
  }
  int rc=StorageResultCode.OperationSucceeded;
  String cmd=String.format("String_Node_Str",oldId,newId);
  try {
    mConnector.doCommand(cmd);
  }
 catch (  NativeDaemonConnectorException e) {
    rc=StorageResultCode.OperationFailedInternalError;
  }
  return rc;
}
Program: 23028
Project: 23028
Buggy source:
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=ruleStr.split(RULE_SEPARATOR);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}

Fixed version (ground truth):
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=getRuleStrings(ruleStr);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}
Program: 23030
Project: 23030
Buggy source:
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=ruleStr.split(RULE_SEPARATOR);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}

Fixed version (ground truth):
private static void addPropertiesForRuleStr(ICalendar.Component component,String propertyName,String ruleStr){
  if (TextUtils.isEmpty(ruleStr)) {
    return;
  }
  String[] rrules=getRuleStrings(ruleStr);
  for (  String rrule : rrules) {
    ICalendar.Property prop=new ICalendar.Property(propertyName);
    prop.setValue(rrule);
    component.addProperty(prop);
  }
}
Program: 23032
Project: 23032
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: 23034
Project: 23034
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: 23036
Project: 23036
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: 23038
Project: 23038
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: 23040
Project: 23040
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: 23041
Project: 23041
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: 23042
Project: 23042
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: 23043
Project: 23043
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: 23044
Project: 23044
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: 23045
Project: 23045
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: 23046
Project: 23046
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: 23051
Project: 23051
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: 23053
Project: 23053
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: 23055
Project: 23055
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: 23057
Project: 23057
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: 23059
Project: 23059
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: 23060
Project: 23060
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: 23061
Project: 23061
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: 23062
Project: 23062
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: 23063
Project: 23063
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: 23064
Project: 23064
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: 23065
Project: 23065
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: 23067
Project: 23067
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: 23069
Project: 23069
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: 23070
Project: 23070
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: 23072
Project: 23072
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: 23074
Project: 23074
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: 23075
Project: 23075
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: 23078
Project: 23078
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();
  }
}