Program: 149584
Project: 149584
Buggy source:
private void run(){
}

Fixed version (ground truth):
private void run(){
  answer[Gaussian2DFunction.BACKGROUND]=benchmarkParameters.getBackground() * benchmarkParameters.gain;
  answer[Gaussian2DFunction.SIGNAL]=benchmarkParameters.getSignal() * benchmarkParameters.gain;
  answer[Gaussian2DFunction.X_POSITION]=benchmarkParameters.x;
  answer[Gaussian2DFunction.Y_POSITION]=benchmarkParameters.y;
  answer[Gaussian2DFunction.X_SD]=benchmarkParameters.s / benchmarkParameters.a;
  answer[Gaussian2DFunction.Y_SD]=benchmarkParameters.s / benchmarkParameters.a;
  int x=(int)benchmarkParameters.x;
  int y=(int)benchmarkParameters.y;
  region=new Rectangle(x - regionSize,y - regionSize,2 * regionSize + 1,2 * regionSize + 1);
  if (!new Rectangle(0,0,imp.getWidth(),imp.getHeight()).contains(region)) {
    if (region.width <= imp.getWidth() + 1 && region.height <= imp.getHeight() + 1) {
      Utils.log("String_Node_Str",region.toString(),imp.getWidth(),imp.getHeight());
      region=new Rectangle(0,0,imp.getWidth(),imp.getHeight());
    }
 else {
      IJ.error(TITLE,"String_Node_Str");
      return;
    }
  }
  x-=region.x;
  y-=region.y;
  answer[Gaussian2DFunction.X_POSITION]-=(region.x + 0.5);
  answer[Gaussian2DFunction.Y_POSITION]-=(region.y + 0.5);
  fitConfig.setBackgroundFitting(backgroundFitting);
  fitConfig.setNotSignalFitting(!signalFitting);
  fitConfig.setComputeDeviations(false);
  final ImageStack stack=imp.getImageStack();
  int nThreads=Prefs.getThreads();
  BlockingQueue<Integer> jobs=new ArrayBlockingQueue<Integer>(nThreads * 2);
  List<Worker> workers=new LinkedList<Worker>();
  List<Thread> threads=new LinkedList<Thread>();
  for (int i=0; i < nThreads; i++) {
    Worker worker=new Worker(jobs,stack,region,fitConfig);
    Thread t=new Thread(worker);
    workers.add(worker);
    threads.add(t);
    t.start();
  }
  final int totalFrames=benchmarkParameters.frames;
  results=new double[totalFrames * getNumberOfStartPoints()][];
  resultsTime=new long[results.length];
  final int step=(totalFrames > 400) ? totalFrames / 200 : 2;
  for (int i=0; i < totalFrames; i++) {
    if (benchmarkParameters.p[i] > 0) {
      put(jobs,i);
      if (i % step == 0) {
        IJ.showProgress(i,totalFrames);
        IJ.showStatus("String_Node_Str" + i + "String_Node_Str"+ totalFrames);
      }
    }
  }
  for (int i=0; i < threads.size(); i++) {
    put(jobs,-1);
  }
  for (int i=0; i < threads.size(); i++) {
    try {
      threads.get(i).join();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  threads.clear();
  if (comFitting)   Utils.log(TITLE + "String_Node_Str",comValid.intValue(),totalFrames,Utils.rounded((100.0 * comValid.intValue()) / totalFrames));
  IJ.showProgress(1);
  IJ.showStatus("String_Node_Str");
  Statistics[] stats=new Statistics[NAMES.length];
  for (int i=0; i < workers.size(); i++) {
    Statistics[] next=workers.get(i).stats;
    for (int j=0; j < next.length; j++) {
      if (stats[j] == null)       stats[j]=next[j];
 else       stats[j].add(next[j]);
    }
  }
  workers.clear();
  summariseResults(stats);
  if (showHistograms) {
    IJ.showStatus("String_Node_Str");
    int[] idList=new int[NAMES.length];
    int count=0;
    double[] convert=getConversionFactors();
    boolean requireRetile=false;
    for (int i=0; i < NAMES.length; i++) {
      if (displayHistograms[i] && convert[i] != 0) {
        double[] tmp=((StoredDataStatistics)stats[i]).getValues();
        for (int j=0; j < tmp.length; j++)         tmp[j]*=convert[i];
        StoredDataStatistics tmpStats=new StoredDataStatistics(tmp);
        idList[count++]=Utils.showHistogram(TITLE,tmpStats,NAMES[i],0,0,histogramBins,String.format("String_Node_Str",Utils.rounded(tmpStats.getMean()),Utils.rounded(tmpStats.getStandardDeviation())));
        requireRetile=requireRetile || Utils.isNewWindow();
      }
    }
    if (count > 0 && requireRetile) {
      idList=Arrays.copyOf(idList,count);
      new WindowOrganiser().tileWindows(idList);
    }
  }
  IJ.showStatus("String_Node_Str");
}