nus-yam/ex-repair huggingface dataset:
Program: 196674
Project: 196674
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace.length() > 10000) {
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ info.crashInfo.stackTrace.substring(256));
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ info.crashInfo.stackTrace.substring(256));
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 196675
Project: 196675
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace.length() > 10000) {
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ info.crashInfo.stackTrace.substring(256));
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ info.crashInfo.stackTrace.substring(256));
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 196676
Project: 196676
Buggy source:
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace.length() > 10000) {
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ info.crashInfo.stackTrace.substring(256));
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called from Parcel.readException() when the exception is EX_STRICT_MODE_VIOLATIONS, we here read back all the encoded violations.
 */
static void readAndHandleBinderCallViolations(Parcel p){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new FastPrintWriter(sw,false,256);
  new LogStackTrace().printStackTrace(pw);
  pw.flush();
  String ourStack=sw.toString();
  int policyMask=getThreadPolicyMask();
  boolean currentlyGathering=(policyMask & PENALTY_GATHER) != 0;
  int numViolations=p.readInt();
  for (int i=0; i < numViolations; ++i) {
    if (LOG_V)     Log.d(TAG,"String_Node_Str" + i);
    ViolationInfo info=new ViolationInfo(p,!currentlyGathering);
    if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) {
      while (i < numViolations) {
        info=new ViolationInfo(p,!currentlyGathering);
        i++;
      }
      clearGatheredViolations();
      Slog.wtfStack(TAG,"String_Node_Str" + numViolations + "String_Node_Str"+ Integer.toHexString(policyMask)+ "String_Node_Str"+ info.crashInfo.stackTrace.substring(256));
      return;
    }
    info.crashInfo.stackTrace+="String_Node_Str" + ourStack;
    BlockGuard.Policy policy=BlockGuard.getThreadPolicy();
    if (policy instanceof AndroidBlockGuardPolicy) {
      ((AndroidBlockGuardPolicy)policy).handleViolationWithTimingAttempt(info);
    }
  }
}
Program: 196699
Project: 196699
Buggy source:
@Override public void onPackageModified(String packageName){
  final int eventUserId=getChangingUserId();
  final PackageManager pm=mContext.getPackageManager();
  final ArrayList<Pair<Intent,Integer>> recentTaskIntents=new ArrayList<Pair<Intent,Integer>>();
  final HashSet<ComponentName> componentsKnownToExist=new HashSet<ComponentName>();
  final ArrayList<Integer> tasksToRemove=new ArrayList<Integer>();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      recentTaskIntents.add(new Pair<Intent,Integer>(tr.intent,tr.taskId));
    }
  }
  for (int i=recentTaskIntents.size() - 1; i >= 0; i--) {
    Pair<Intent,Integer> p=recentTaskIntents.get(i);
    ComponentName cn=p.first.getComponent();
    if (cn != null && cn.getPackageName().equals(packageName)) {
      if (componentsKnownToExist.contains(cn)) {
        continue;
      }
      try {
        ActivityInfo info=pm.getActivityInfo(cn,eventUserId);
        if (info != null && info.isEnabled()) {
          componentsKnownToExist.add(cn);
        }
 else {
          tasksToRemove.add(p.second);
        }
      }
 catch (      Exception e) {
      }
    }
  }
synchronized (ActivityManagerService.this) {
    for (int i=tasksToRemove.size() - 1; i >= 0; i--) {
      removeTaskByIdLocked(tasksToRemove.get(i),0);
    }
  }
}

Fixed version (ground truth):
@Override public void onPackageModified(String packageName){
  final int eventUserId=getChangingUserId();
  final IPackageManager pm=AppGlobals.getPackageManager();
  final ArrayList<Pair<Intent,Integer>> recentTaskIntents=new ArrayList<Pair<Intent,Integer>>();
  final HashSet<ComponentName> componentsKnownToExist=new HashSet<ComponentName>();
  final ArrayList<Integer> tasksToRemove=new ArrayList<Integer>();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      recentTaskIntents.add(new Pair<Intent,Integer>(tr.intent,tr.taskId));
    }
  }
  for (int i=recentTaskIntents.size() - 1; i >= 0; i--) {
    Pair<Intent,Integer> p=recentTaskIntents.get(i);
    ComponentName cn=p.first.getComponent();
    if (cn != null && cn.getPackageName().equals(packageName)) {
      if (componentsKnownToExist.contains(cn)) {
        continue;
      }
      try {
        ActivityInfo info=pm.getActivityInfo(cn,0,eventUserId);
        if (info != null) {
          componentsKnownToExist.add(cn);
        }
 else {
          tasksToRemove.add(p.second);
        }
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + cn,e);
      }
    }
  }
synchronized (ActivityManagerService.this) {
    for (int i=tasksToRemove.size() - 1; i >= 0; i--) {
      removeTaskByIdLocked(tasksToRemove.get(i),0);
    }
  }
}
Program: 196700
Project: 196700
Buggy source:
@Override public boolean isActivityEnabled(ComponentName component,UserHandle user) throws RemoteException {
  ensureInUserProfiles(user,"String_Node_Str" + user);
  if (!isUserEnabled(user)) {
    return false;
  }
  long ident=Binder.clearCallingIdentity();
  try {
    IPackageManager pm=AppGlobals.getPackageManager();
    ActivityInfo info=pm.getActivityInfo(component,0,user.getIdentifier());
    return info != null && info.isEnabled();
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
@Override public boolean isActivityEnabled(ComponentName component,UserHandle user) throws RemoteException {
  ensureInUserProfiles(user,"String_Node_Str" + user);
  if (!isUserEnabled(user)) {
    return false;
  }
  long ident=Binder.clearCallingIdentity();
  try {
    IPackageManager pm=AppGlobals.getPackageManager();
    ActivityInfo info=pm.getActivityInfo(component,0,user.getIdentifier());
    return info != null;
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 196701
Project: 196701
Buggy source:
@Override public void onPackageModified(String packageName){
  final int eventUserId=getChangingUserId();
  final PackageManager pm=mContext.getPackageManager();
  final ArrayList<Pair<Intent,Integer>> recentTaskIntents=new ArrayList<Pair<Intent,Integer>>();
  final HashSet<ComponentName> componentsKnownToExist=new HashSet<ComponentName>();
  final ArrayList<Integer> tasksToRemove=new ArrayList<Integer>();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      recentTaskIntents.add(new Pair<Intent,Integer>(tr.intent,tr.taskId));
    }
  }
  for (int i=recentTaskIntents.size() - 1; i >= 0; i--) {
    Pair<Intent,Integer> p=recentTaskIntents.get(i);
    ComponentName cn=p.first.getComponent();
    if (cn != null && cn.getPackageName().equals(packageName)) {
      if (componentsKnownToExist.contains(cn)) {
        continue;
      }
      try {
        ActivityInfo info=pm.getActivityInfo(cn,eventUserId);
        if (info != null && info.isEnabled()) {
          componentsKnownToExist.add(cn);
        }
 else {
          tasksToRemove.add(p.second);
        }
      }
 catch (      Exception e) {
      }
    }
  }
synchronized (ActivityManagerService.this) {
    for (int i=tasksToRemove.size() - 1; i >= 0; i--) {
      removeTaskByIdLocked(tasksToRemove.get(i),0);
    }
  }
}

Fixed version (ground truth):
@Override public void onPackageModified(String packageName){
  final int eventUserId=getChangingUserId();
  final IPackageManager pm=AppGlobals.getPackageManager();
  final ArrayList<Pair<Intent,Integer>> recentTaskIntents=new ArrayList<Pair<Intent,Integer>>();
  final HashSet<ComponentName> componentsKnownToExist=new HashSet<ComponentName>();
  final ArrayList<Integer> tasksToRemove=new ArrayList<Integer>();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      recentTaskIntents.add(new Pair<Intent,Integer>(tr.intent,tr.taskId));
    }
  }
  for (int i=recentTaskIntents.size() - 1; i >= 0; i--) {
    Pair<Intent,Integer> p=recentTaskIntents.get(i);
    ComponentName cn=p.first.getComponent();
    if (cn != null && cn.getPackageName().equals(packageName)) {
      if (componentsKnownToExist.contains(cn)) {
        continue;
      }
      try {
        ActivityInfo info=pm.getActivityInfo(cn,0,eventUserId);
        if (info != null) {
          componentsKnownToExist.add(cn);
        }
 else {
          tasksToRemove.add(p.second);
        }
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + cn,e);
      }
    }
  }
synchronized (ActivityManagerService.this) {
    for (int i=tasksToRemove.size() - 1; i >= 0; i--) {
      removeTaskByIdLocked(tasksToRemove.get(i),0);
    }
  }
}
Program: 196702
Project: 196702
Buggy source:
@Override public boolean isActivityEnabled(ComponentName component,UserHandle user) throws RemoteException {
  ensureInUserProfiles(user,"String_Node_Str" + user);
  if (!isUserEnabled(user)) {
    return false;
  }
  long ident=Binder.clearCallingIdentity();
  try {
    IPackageManager pm=AppGlobals.getPackageManager();
    ActivityInfo info=pm.getActivityInfo(component,0,user.getIdentifier());
    return info != null && info.isEnabled();
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}

Fixed version (ground truth):
@Override public boolean isActivityEnabled(ComponentName component,UserHandle user) throws RemoteException {
  ensureInUserProfiles(user,"String_Node_Str" + user);
  if (!isUserEnabled(user)) {
    return false;
  }
  long ident=Binder.clearCallingIdentity();
  try {
    IPackageManager pm=AppGlobals.getPackageManager();
    ActivityInfo info=pm.getActivityInfo(component,0,user.getIdentifier());
    return info != null;
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 196708
Project: 196708
Buggy source:
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}

Fixed version (ground truth):
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks != null && mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}
Program: 196712
Project: 196712
Buggy source:
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}

Fixed version (ground truth):
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (!mService.mBooting && !mService.mBooted) {
    return false;
  }
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}
Program: 196714
Project: 196714
Buggy source:
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
  resumeHomeStackTask(HOME_ACTIVITY_TYPE,null);
}

Fixed version (ground truth):
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
}
Program: 196723
Project: 196723
Buggy source:
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}

Fixed version (ground truth):
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks != null && mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}
Program: 196727
Project: 196727
Buggy source:
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}

Fixed version (ground truth):
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (!mService.mBooting && !mService.mBooted) {
    return false;
  }
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}
Program: 196729
Project: 196729
Buggy source:
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
  resumeHomeStackTask(HOME_ACTIVITY_TYPE,null);
}

Fixed version (ground truth):
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
}
Program: 196734
Project: 196734
Buggy source:
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}

Fixed version (ground truth):
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks != null && mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}
Program: 196738
Project: 196738
Buggy source:
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}

Fixed version (ground truth):
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (!mService.mBooting && !mService.mBooted) {
    return false;
  }
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}
Program: 196740
Project: 196740
Buggy source:
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
  resumeHomeStackTask(HOME_ACTIVITY_TYPE,null);
}

Fixed version (ground truth):
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
}
Program: 196744
Project: 196744
Buggy source:
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}

Fixed version (ground truth):
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks != null && mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}
Program: 196748
Project: 196748
Buggy source:
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}

Fixed version (ground truth):
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (!mService.mBooting && !mService.mBooted) {
    return false;
  }
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}
Program: 196750
Project: 196750
Buggy source:
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
  resumeHomeStackTask(HOME_ACTIVITY_TYPE,null);
}

Fixed version (ground truth):
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
}
Program: 196753
Project: 196753
Buggy source:
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}

Fixed version (ground truth):
void dumpRecentsLocked(FileDescriptor fd,PrintWriter pw,String[] args,int opti,boolean dumpAll,String dumpPackage){
  pw.println("String_Node_Str");
  boolean printedAnything=false;
  if (mRecentTasks != null && mRecentTasks.size() > 0) {
    boolean printedHeader=false;
    final int N=mRecentTasks.size();
    for (int i=0; i < N; i++) {
      TaskRecord tr=mRecentTasks.get(i);
      if (dumpPackage != null) {
        if (tr.realActivity == null || !dumpPackage.equals(tr.realActivity)) {
          continue;
        }
      }
      if (!printedHeader) {
        pw.println("String_Node_Str");
        printedHeader=true;
        printedAnything=true;
      }
      pw.print("String_Node_Str");
      pw.print(i);
      pw.print("String_Node_Str");
      pw.println(tr);
      if (dumpAll) {
        mRecentTasks.get(i).dump(pw,"String_Node_Str");
      }
    }
  }
  if (!printedAnything) {
    pw.println("String_Node_Str");
  }
}
Program: 196757
Project: 196757
Buggy source:
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}

Fixed version (ground truth):
boolean resumeHomeStackTask(int homeStackTaskType,ActivityRecord prev){
  if (!mService.mBooting && !mService.mBooted) {
    return false;
  }
  if (homeStackTaskType == RECENTS_ACTIVITY_TYPE) {
    mWindowManager.showRecentApps();
    return false;
  }
  moveHomeStackTaskToTop(homeStackTaskType);
  if (prev != null) {
    prev.task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE);
  }
  ActivityRecord r=mHomeStack.topRunningActivityLocked(null);
  if (r != null && r.isHomeActivity()) {
    mService.setFocusedActivityLocked(r);
    return resumeTopActivitiesLocked(mHomeStack,prev,null);
  }
  return mService.startHomeActivityLocked(mCurrentUser);
}
Program: 196759
Project: 196759
Buggy source:
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
  resumeHomeStackTask(HOME_ACTIVITY_TYPE,null);
}

Fixed version (ground truth):
void createStackForRestoredTaskHistory(ArrayList<TaskRecord> tasks){
  int stackId=createStackOnDisplay(getNextStackId(),Display.DEFAULT_DISPLAY);
  final ActivityStack stack=getStack(stackId);
  for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) {
    final TaskRecord task=tasks.get(taskNdx);
    stack.addTask(task,false,false);
    final int taskId=task.taskId;
    final ArrayList<ActivityRecord> activities=task.mActivities;
    for (int activityNdx=activities.size() - 1; activityNdx >= 0; --activityNdx) {
      final ActivityRecord r=activities.get(activityNdx);
      mWindowManager.addAppToken(0,r.appToken,taskId,stackId,r.info.screenOrientation,r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0,r.userId,r.info.configChanges,task.voiceSession != null,r.mLaunchTaskBehind);
    }
  }
}
Program: 196764
Project: 196764
Buggy source:
/** 
 * Sets the primary color for this task description.
 * @hide
 */
public void setPrimaryColor(int primaryColor){
  mColorPrimary=0xFF000000 | primaryColor;
}

Fixed version (ground truth):
/** 
 * Sets the primary color for this task description.
 * @hide
 */
public void setPrimaryColor(int primaryColor){
  if ((primaryColor != 0) && (Color.alpha(primaryColor) != 255)) {
    throw new RuntimeException("String_Node_Str");
  }
  mColorPrimary=primaryColor;
}
Program: 196767
Project: 196767
Buggy source:
public void onStart(){
}

Fixed version (ground truth):
public void onStart(){
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout();
  if (Constants.DebugFlags.App.EnableSearchLayout) {
    if (mConfig.searchBarAppWidgetId < 0) {
      AppWidgetHost host=new RecentsAppWidgetHost(mContext,Constants.Values.App.AppWidgetHostId);
      Pair<Integer,AppWidgetProviderInfo> widgetInfo=mSystemServicesProxy.bindSearchAppWidget(host);
      if (widgetInfo != null) {
        mConfig.updateSearchBarAppWidgetId(mContext,widgetInfo.first);
      }
    }
  }
}
Program: 196768
Project: 196768
Buggy source:
public void onBootCompleted(){
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout();
  mBootCompleted=true;
  if (Constants.DebugFlags.App.EnableSearchLayout) {
    if (mConfig.searchBarAppWidgetId < 0) {
      AppWidgetHost host=new RecentsAppWidgetHost(mContext,Constants.Values.App.AppWidgetHostId);
      Pair<Integer,AppWidgetProviderInfo> widgetInfo=mSystemServicesProxy.bindSearchAppWidget(host);
      if (widgetInfo != null) {
        mConfig.updateSearchBarAppWidgetId(mContext,widgetInfo.first);
      }
    }
  }
}

Fixed version (ground truth):
public void onBootCompleted(){
  mBootCompleted=true;
}
Program: 196771
Project: 196771
Buggy source:
/** 
 * Sets the primary color for this task description.
 * @hide
 */
public void setPrimaryColor(int primaryColor){
  mColorPrimary=0xFF000000 | primaryColor;
}

Fixed version (ground truth):
/** 
 * Sets the primary color for this task description.
 * @hide
 */
public void setPrimaryColor(int primaryColor){
  if ((primaryColor != 0) && (Color.alpha(primaryColor) != 255)) {
    throw new RuntimeException("String_Node_Str");
  }
  mColorPrimary=primaryColor;
}
Program: 196772
Project: 196772
Buggy source:
public void onStart(){
}

Fixed version (ground truth):
public void onStart(){
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout();
  if (Constants.DebugFlags.App.EnableSearchLayout) {
    if (mConfig.searchBarAppWidgetId < 0) {
      AppWidgetHost host=new RecentsAppWidgetHost(mContext,Constants.Values.App.AppWidgetHostId);
      Pair<Integer,AppWidgetProviderInfo> widgetInfo=mSystemServicesProxy.bindSearchAppWidget(host);
      if (widgetInfo != null) {
        mConfig.updateSearchBarAppWidgetId(mContext,widgetInfo.first);
      }
    }
  }
}
Program: 196773
Project: 196773
Buggy source:
public void onBootCompleted(){
  TaskStackViewLayoutAlgorithm.initializeCurve();
  reloadHeaderBarLayout();
  mBootCompleted=true;
  if (Constants.DebugFlags.App.EnableSearchLayout) {
    if (mConfig.searchBarAppWidgetId < 0) {
      AppWidgetHost host=new RecentsAppWidgetHost(mContext,Constants.Values.App.AppWidgetHostId);
      Pair<Integer,AppWidgetProviderInfo> widgetInfo=mSystemServicesProxy.bindSearchAppWidget(host);
      if (widgetInfo != null) {
        mConfig.updateSearchBarAppWidgetId(mContext,widgetInfo.first);
      }
    }
  }
}

Fixed version (ground truth):
public void onBootCompleted(){
  mBootCompleted=true;
}
Program: 196775
Project: 196775
Buggy source:
/** 
 * @hide
 */
public FragmentBreadCrumbs(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  final TypedArray a=context.obtainStyledAttributes(attrs,com.android.internal.R.styleable.FragmentBreadCrumbs,defStyleAttr,defStyleRes);
  mGravity=a.getInt(com.android.internal.R.styleable.FragmentBreadCrumbs_gravity,DEFAULT_GRAVITY);
  a.recycle();
}

Fixed version (ground truth):
/** 
 * @hide
 */
public FragmentBreadCrumbs(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  final TypedArray a=context.obtainStyledAttributes(attrs,com.android.internal.R.styleable.FragmentBreadCrumbs,defStyleAttr,defStyleRes);
  mGravity=a.getInt(com.android.internal.R.styleable.FragmentBreadCrumbs_gravity,DEFAULT_GRAVITY);
  mLayoutResId=a.getResourceId(com.android.internal.R.styleable.FragmentBreadCrumbs_itemLayout,com.android.internal.R.layout.fragment_bread_crumb_item);
  mTextColor=a.getColor(com.android.internal.R.styleable.FragmentBreadCrumbs_itemColor,0);
  a.recycle();
}
Program: 196776
Project: 196776
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  HeaderViewHolder holder;
  View view;
  if (convertView == null) {
    view=mInflater.inflate(com.android.internal.R.layout.preference_header_item,parent,false);
    holder=new HeaderViewHolder();
    holder.icon=(ImageView)view.findViewById(com.android.internal.R.id.icon);
    holder.title=(TextView)view.findViewById(com.android.internal.R.id.title);
    holder.summary=(TextView)view.findViewById(com.android.internal.R.id.summary);
    view.setTag(holder);
  }
 else {
    view=convertView;
    holder=(HeaderViewHolder)view.getTag();
  }
  Header header=getItem(position);
  holder.icon.setImageResource(header.iconRes);
  holder.title.setText(header.getTitle(getContext().getResources()));
  CharSequence summary=header.getSummary(getContext().getResources());
  if (!TextUtils.isEmpty(summary)) {
    holder.summary.setVisibility(View.VISIBLE);
    holder.summary.setText(summary);
  }
 else {
    holder.summary.setVisibility(View.GONE);
  }
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  HeaderViewHolder holder;
  View view;
  if (convertView == null) {
    view=mInflater.inflate(mLayoutResId,parent,false);
    holder=new HeaderViewHolder();
    holder.icon=(ImageView)view.findViewById(com.android.internal.R.id.icon);
    holder.title=(TextView)view.findViewById(com.android.internal.R.id.title);
    holder.summary=(TextView)view.findViewById(com.android.internal.R.id.summary);
    view.setTag(holder);
  }
 else {
    view=convertView;
    holder=(HeaderViewHolder)view.getTag();
  }
  Header header=getItem(position);
  if (mRemoveIconIfEmpty) {
    if (header.iconRes == 0) {
      holder.icon.setVisibility(View.GONE);
    }
 else {
      holder.icon.setVisibility(View.VISIBLE);
      holder.icon.setImageResource(header.iconRes);
    }
  }
 else {
    holder.icon.setImageResource(header.iconRes);
  }
  holder.title.setText(header.getTitle(getContext().getResources()));
  CharSequence summary=header.getSummary(getContext().getResources());
  if (!TextUtils.isEmpty(summary)) {
    holder.summary.setVisibility(View.VISIBLE);
    holder.summary.setText(summary);
  }
 else {
    holder.summary.setVisibility(View.GONE);
  }
  return view;
}