Program: 22757
Project: 22757
Buggy source:
/** 
 * Classify instance concurrently
 * @param data set of instances to classify
 * @param classifier current classifier
 * @param probabilityMaps return a probability map for each class instead of aclassified image
 * @return classification result
 */
private static Callable<double[][]> classifyInstances(final Instances data,final AbstractClassifier classifier,final AtomicInteger counter,final boolean probabilityMaps){
  if (Thread.currentThread().isInterrupted())   return null;
  return new Callable<double[][]>(){
    public double[][] call(){
      final int numInstances=data.numInstances();
      final int numClasses=data.numClasses();
      final double[][] classificationResult;
      if (probabilityMaps)       classificationResult=new double[numClasses][numInstances];
 else       classificationResult=new double[1][numInstances];
      for (int i=0; i < numInstances; i++) {
        try {
          if (0 == i % 4000) {
            if (Thread.currentThread().isInterrupted())             return null;
            counter.addAndGet(4000);
          }
          if (probabilityMaps) {
            double[] prob=classifier.distributionForInstance(data.get(i));
            for (int k=0; k < numClasses; k++)             classificationResult[k][i]=prob[k];
          }
 else {
            if (null == data.get(i))             IJ.log("String_Node_Str" + i + "String_Node_Str");
 else             classificationResult[0][i]=classifier.classifyInstance(data.get(i));
          }
        }
 catch (        Exception e) {
          IJ.showMessage("String_Node_Str");
          e.printStackTrace();
          return null;
        }
      }
      return classificationResult;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Classify instance concurrently
 * @param data set of instances to classify
 * @param classifier current classifier
 * @param probabilityMaps return a probability map for each class instead of aclassified image
 * @return classification result
 */
private static Callable<double[][]> classifyInstances(final Instances data,final AbstractClassifier classifier,final AtomicInteger counter,final boolean probabilityMaps){
  if (Thread.currentThread().isInterrupted())   return null;
  return new Callable<double[][]>(){
    public double[][] call(){
      final int numInstances=data.numInstances();
      final int numClasses=data.numClasses();
      final double[][] classificationResult;
      if (probabilityMaps)       classificationResult=new double[numClasses][numInstances];
 else       classificationResult=new double[1][numInstances];
      for (int i=0; i < numInstances; i++) {
        try {
          if (0 == i % 4000) {
            if (Thread.currentThread().isInterrupted())             return null;
            counter.addAndGet(4000);
          }
          if (probabilityMaps) {
            double[] prob=classifier.distributionForInstance(data.get(i));
            for (int k=0; k < numClasses; k++)             classificationResult[k][i]=prob[k];
          }
 else {
            classificationResult[0][i]=classifier.classifyInstance(data.get(i));
          }
        }
 catch (        Exception e) {
          IJ.showMessage("String_Node_Str");
          e.printStackTrace();
          return null;
        }
      }
      return classificationResult;
    }
  }
;
}