Program: 195752
Project: 195752
Buggy source:
/** 
 * Called to apply the actual loading based on the specified conditions.
 */
synchronized void executePlan(Options opts,RecentsTaskLoader loader,TaskResourceLoadQueue loadQueue){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + opts.numVisibleTasks + "String_Node_Str"+ opts.numVisibleTaskThumbnails+ "String_Node_Str"+ opts.runningTaskId);
  Resources res=mContext.getResources();
  ArrayList<Task> tasks=mStack.getTasks();
  int taskCount=tasks.size();
  for (int i=0; i < taskCount; i++) {
    ActivityManager.RecentTaskInfo t=mRawTasks.get(i);
    Task task=tasks.get(i);
    Task.TaskKey taskKey=task.key;
    Task.ComponentNameKey cnKey=taskKey.getComponentNameKey();
    ActivityInfoHandle infoHandle;
    boolean hadCachedActivityInfo=false;
    if (mActivityInfoCache.containsKey(cnKey)) {
      infoHandle=mActivityInfoCache.get(cnKey);
      hadCachedActivityInfo=true;
    }
 else {
      infoHandle=new ActivityInfoHandle();
    }
    boolean isRunningTask=(task.key.id == opts.runningTaskId);
    boolean isVisibleTask=i >= (taskCount - opts.numVisibleTasks);
    boolean isVisibleThumbnail=i >= (taskCount - opts.numVisibleTaskThumbnails);
    if (opts.loadIcons && (isRunningTask || isVisibleTask)) {
      if (task.activityIcon == null) {
        if (DEBUG)         Log.d(TAG,"String_Node_Str" + taskKey);
        task.activityIcon=loader.getAndUpdateActivityIcon(taskKey,t.taskDescription,mSystemServicesProxy,res,infoHandle,true);
      }
    }
    if (opts.loadThumbnails && (isRunningTask || isVisibleThumbnail)) {
      if (task.thumbnail == null) {
        if (DEBUG)         Log.d(TAG,"String_Node_Str" + taskKey);
        if (mConfig.svelteLevel <= RecentsConfiguration.SVELTE_LIMIT_CACHE) {
          task.thumbnail=loader.getAndUpdateThumbnail(taskKey,mSystemServicesProxy,true);
        }
 else         if (mConfig.svelteLevel == RecentsConfiguration.SVELTE_DISABLE_CACHE) {
          loadQueue.addTask(task);
        }
      }
    }
    if (!hadCachedActivityInfo && infoHandle.info != null) {
      mActivityInfoCache.put(cnKey,infoHandle);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called to apply the actual loading based on the specified conditions.
 */
synchronized void executePlan(Options opts,RecentsTaskLoader loader,TaskResourceLoadQueue loadQueue){
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + opts.numVisibleTasks + "String_Node_Str"+ opts.numVisibleTaskThumbnails+ "String_Node_Str"+ opts.runningTaskId);
  Resources res=mContext.getResources();
  ArrayList<Task> tasks=mStack.getTasks();
  int taskCount=tasks.size();
  for (int i=0; i < taskCount; i++) {
    ActivityManager.RecentTaskInfo t=mRawTasks.get(i);
    Task task=tasks.get(i);
    Task.TaskKey taskKey=task.key;
    Task.ComponentNameKey cnKey=taskKey.getComponentNameKey();
    ActivityInfoHandle infoHandle;
    boolean hadCachedActivityInfo=false;
    if (mActivityInfoCache.containsKey(cnKey)) {
      infoHandle=mActivityInfoCache.get(cnKey);
      hadCachedActivityInfo=true;
    }
 else {
      infoHandle=new ActivityInfoHandle();
    }
    boolean isRunningTask=(task.key.id == opts.runningTaskId);
    boolean isVisibleTask=i >= (taskCount - opts.numVisibleTasks);
    boolean isVisibleThumbnail=i >= (taskCount - opts.numVisibleTaskThumbnails);
    if (opts.onlyLoadPausedActivities && isRunningTask) {
      continue;
    }
    if (opts.loadIcons && (isRunningTask || isVisibleTask)) {
      if (task.activityIcon == null) {
        if (DEBUG)         Log.d(TAG,"String_Node_Str" + taskKey);
        task.activityIcon=loader.getAndUpdateActivityIcon(taskKey,t.taskDescription,mSystemServicesProxy,res,infoHandle,true);
      }
    }
    if (opts.loadThumbnails && (isRunningTask || isVisibleThumbnail)) {
      if (task.thumbnail == null || isRunningTask) {
        if (DEBUG)         Log.d(TAG,"String_Node_Str" + taskKey);
        if (mConfig.svelteLevel <= RecentsConfiguration.SVELTE_LIMIT_CACHE) {
          task.thumbnail=loader.getAndUpdateThumbnail(taskKey,mSystemServicesProxy,true);
        }
 else         if (mConfig.svelteLevel == RecentsConfiguration.SVELTE_DISABLE_CACHE) {
          loadQueue.addTask(task);
        }
      }
    }
    if (!hadCachedActivityInfo && infoHandle.info != null) {
      mActivityInfoCache.put(cnKey,infoHandle);
    }
  }
}