Program: 56350
Project: 56350
Buggy source:
/** 
 * Populates and return pipelines for the supplied pipeline prototype with the current status.
 * @param noOfPipelines number of pipeline instances
 */
public List<Pipeline> createPipelineLatest(int noOfPipelines,ItemGroup context,boolean pagingEnabled){
  List<Pipeline> result=new ArrayList<Pipeline>();
  int no=noOfPipelines;
  if (firstProject.isInQueue()) {
    String pipeLineTimestamp=PipelineUtils.formatTimestamp(firstProject.getQueueItem().getInQueueSince());
    List<Stage> pipelineStages=new ArrayList<Stage>();
    for (    Stage stage : getStages()) {
      pipelineStages.add(stage.createLatestStage(context,null));
    }
    Pipeline pipelineLatest=new Pipeline(getName(),firstProject,lastProject,"String_Node_Str" + firstProject.getNextBuildNumber(),pipeLineTimestamp,TriggerCause.getTriggeredBy(firstProject,null),null,pipelineStages,false);
    result.add(pipelineLatest);
    no--;
  }
  int pipelineCount=noOfPipelines;
  if (pagingEnabled) {
    pipelineCount=firstProject.getBuilds().size();
  }
  Iterator it=firstProject.getBuilds().iterator();
  for (int i=0; i < pipelineCount && it.hasNext(); i++) {
    AbstractBuild firstBuild=(AbstractBuild)it.next();
    List<Change> pipelineChanges=Change.getChanges(firstBuild);
    String pipeLineTimestamp=PipelineUtils.formatTimestamp(firstBuild.getTimeInMillis());
    List<Stage> pipelineStages=new ArrayList<Stage>();
    for (    Stage stage : getStages()) {
      pipelineStages.add(stage.createLatestStage(context,firstBuild));
    }
    Pipeline pipelineLatest=new Pipeline(getName(),firstProject,lastProject,firstBuild.getDisplayName(),pipeLineTimestamp,TriggerCause.getTriggeredBy(firstProject,firstBuild),UserInfo.getContributors(firstBuild),pipelineStages,false);
    pipelineLatest.setChanges(pipelineChanges);
    pipelineLatest.calculateTotalBuildTime();
    result.add(pipelineLatest);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Populates and return pipelines for the supplied pipeline prototype with the current status.
 * @param noOfPipelines number of pipeline instances
 */
public List<Pipeline> createPipelineLatest(int noOfPipelines,ItemGroup context,boolean pagingEnabled,Component component){
  List<Pipeline> result=new ArrayList<Pipeline>();
  int no=noOfPipelines;
  if (firstProject.isInQueue()) {
    String pipeLineTimestamp=PipelineUtils.formatTimestamp(firstProject.getQueueItem().getInQueueSince());
    List<Stage> pipelineStages=new ArrayList<Stage>();
    for (    Stage stage : getStages()) {
      pipelineStages.add(stage.createLatestStage(context,null));
    }
    Pipeline pipelineLatest=new Pipeline(getName(),firstProject,lastProject,"String_Node_Str" + firstProject.getNextBuildNumber(),pipeLineTimestamp,TriggerCause.getTriggeredBy(firstProject,null),null,pipelineStages,false);
    result.add(pipelineLatest);
    no--;
  }
  int totalNoOfPipelines=firstProject.getBuilds().size();
  component.setTotalNoOfPipelines(totalNoOfPipelines);
  int startIndex=0;
  int retrieveSize=noOfPipelines;
  if (pagingEnabled && !component.isFullScreenView()) {
    startIndex=(component.getCurrentPage() - 1) * noOfPipelines;
    retrieveSize=Math.min(totalNoOfPipelines - ((component.getCurrentPage() - 1) * noOfPipelines),noOfPipelines);
  }
  Iterator it=firstProject.getBuilds().listIterator(startIndex);
  for (int i=startIndex; i < (startIndex + retrieveSize) && it.hasNext(); i++) {
    AbstractBuild firstBuild=(AbstractBuild)it.next();
    List<Change> pipelineChanges=Change.getChanges(firstBuild);
    String pipeLineTimestamp=PipelineUtils.formatTimestamp(firstBuild.getTimeInMillis());
    List<Stage> pipelineStages=new ArrayList<Stage>();
    for (    Stage stage : getStages()) {
      pipelineStages.add(stage.createLatestStage(context,firstBuild));
    }
    Pipeline pipelineLatest=new Pipeline(getName(),firstProject,lastProject,firstBuild.getDisplayName(),pipeLineTimestamp,TriggerCause.getTriggeredBy(firstProject,firstBuild),UserInfo.getContributors(firstBuild),pipelineStages,false);
    pipelineLatest.setChanges(pipelineChanges);
    pipelineLatest.calculateTotalBuildTime();
    result.add(pipelineLatest);
  }
  return result;
}