Program: 64403
Project: 64403
Buggy source:
@Override protected Object doMainTask(TaskMonitor monitor,ObjectRepository repository){
  Option[] variedParamValueOptions=this.variedParamValuesOption.getList();
  double[] variedParamValues=new double[variedParamValueOptions.length];
  for (int i=0; i < variedParamValueOptions.length; i++) {
    variedParamValues[i]=Double.valueOf(variedParamValueOptions[i].getValueAsCLIString());
  }
  PreviewCollection<PreviewCollectionLearningCurveWrapper> previewCollection=new PreviewCollection<>("String_Node_Str","String_Node_Str",this.getClass(),this.variedParamNameOption.getValueAsCLIString(),variedParamValues);
  monitor.setCurrentActivity("String_Node_Str",-1.0);
  for (int i=0; i < this.subtaskThreads.size(); ++i) {
    subtaskThreads.get(i).start();
  }
  int numSubtaskThreads=subtaskThreads.size();
  boolean allThreadsCompleted=false;
  while (!allThreadsCompleted) {
    allThreadsCompleted=true;
    int oldNumEntries=previewCollection.numEntries();
    double completionSum=0;
    for (int i=0; i < numSubtaskThreads; ++i) {
      ALTaskThread currentTaskThread=subtaskThreads.get(i);
      allThreadsCompleted&=currentTaskThread.isComplete();
      if (currentTaskThread.failed() || currentTaskThread.cancelled()) {
        monitor.requestCancel();
      }
      completionSum+=currentTaskThread.getCurrentActivityFracComplete();
      PreviewCollectionLearningCurveWrapper latestPreview=(PreviewCollectionLearningCurveWrapper)currentTaskThread.getLatestResultPreview();
      if (latestPreview != null && latestPreview.numEntries() > 0) {
        previewCollection.setPreview(i,latestPreview);
      }
 else {
        break;
      }
    }
    double completionFraction=completionSum / numSubtaskThreads;
    monitor.setCurrentActivityFractionComplete(completionFraction);
    if (monitor.taskShouldAbort()) {
      return null;
    }
    if (oldNumEntries < previewCollection.numEntries()) {
      if (monitor.resultPreviewRequested() || isSubtask()) {
        monitor.setLatestResultPreview(previewCollection.copy());
        monitor.setCurrentActivityFractionComplete(-1.0);
      }
    }
  }
  return previewCollection;
}

Fixed version (ground truth):
@Override protected Object doMainTask(TaskMonitor monitor,ObjectRepository repository){
  Option[] variedParamValueOptions=this.variedParamValuesOption.getList();
  double[] variedParamValues=new double[variedParamValueOptions.length];
  for (int i=0; i < variedParamValueOptions.length; i++) {
    variedParamValues[i]=Double.valueOf(variedParamValueOptions[i].getValueAsCLIString());
  }
  PreviewCollection<PreviewCollectionLearningCurveWrapper> previewCollection=new PreviewCollection<>("String_Node_Str","String_Node_Str",this.getClass(),this.variedParamNameOption.getValueAsCLIString(),variedParamValues);
  monitor.setCurrentActivity("String_Node_Str",-1.0);
  for (int i=0; i < this.subtaskThreads.size(); ++i) {
    subtaskThreads.get(i).start();
  }
  int numSubtaskThreads=subtaskThreads.size();
  boolean allThreadsCompleted=false;
  while (!allThreadsCompleted) {
    allThreadsCompleted=true;
    int oldNumEntries=previewCollection.numEntries();
    double completionSum=0;
    for (int i=0; i < numSubtaskThreads; ++i) {
      ALTaskThread currentTaskThread=subtaskThreads.get(i);
      allThreadsCompleted&=currentTaskThread.isComplete();
      if (currentTaskThread.failed() || currentTaskThread.cancelled()) {
        monitor.requestCancel();
      }
      completionSum+=currentTaskThread.getCurrentActivityFracComplete();
      PreviewCollectionLearningCurveWrapper latestPreview=(PreviewCollectionLearningCurveWrapper)currentTaskThread.getLatestResultPreview();
      if (latestPreview != null && latestPreview.numEntries() > 0) {
        previewCollection.setPreview(i,latestPreview);
      }
 else       if (!currentTaskThread.isComplete()) {
        break;
      }
    }
    double completionFraction=completionSum / numSubtaskThreads;
    monitor.setCurrentActivityFractionComplete(completionFraction);
    if (monitor.taskShouldAbort()) {
      return null;
    }
    if (oldNumEntries < previewCollection.numEntries()) {
      if (monitor.resultPreviewRequested() || isSubtask()) {
        monitor.setLatestResultPreview(previewCollection.copy());
        monitor.setCurrentActivityFractionComplete(-1.0);
      }
    }
  }
  return previewCollection;
}