Program: 107852
Project: 107852
Buggy source:
@Override public QualityMeasureColumnOriented evaluate(){
  int[] indices=getIndices();
  DataHandleInternal output=getOutput();
  String[][][] hierarchies=getHierarchies();
  double[] result=new double[indices.length];
  double[] min=new double[indices.length];
  double[] max=new double[indices.length];
  for (int i=0; i < result.length; i++) {
    int column=indices[i];
    try {
      Map<String,String>[] generalizationFunctions=getGeneralizationFunctions(hierarchies,i);
      Map<String,Integer> inverseGeneralizationFunction=getInverseGeneralizationFunction(hierarchies,i);
      final int[] transformations=new int[output.getNumRows()];
      for (int row=0; row < output.getNumRows(); row++) {
        transformations[row]=inverseGeneralizationFunction.get(output.getValue(row,column));
      }
      Set<Integer> _levels=new HashSet<Integer>();
      for (      int level : transformations) {
        _levels.add(level);
      }
      List<Integer> levels=new ArrayList<Integer>();
      levels.addAll(_levels);
      Collections.sort(levels);
      for (int levelIndex=0; levelIndex < levels.size(); levelIndex++) {
        int currentLevel=levels.get(levelIndex);
        int previousLevel=levelIndex > 0 ? levels.get(levelIndex - 1) : currentLevel;
        Map<String,Double> inputFrequencies=levelIndex == 0 ? inputFrequencies=getInputFrequencies(transformations,column,currentLevel) : getOutputFrequencies(transformations,generalizationFunctions,column,currentLevel,previousLevel);
        Map<String,Double> outputFrequencies=getOutputFrequencies(transformations,generalizationFunctions,column,currentLevel,currentLevel);
        DataHandleInternal input=getInput();
        for (int row=0; row < input.getNumRows(); row++) {
          String value=input.getValue(row,column);
          String inputValue=levelIndex == 0 ? value : generalizationFunctions[previousLevel].get(value);
          String outputValue=generalizationFunctions[currentLevel].get(value);
          if (transformations[row] >= currentLevel) {
            result[i]+=log2(inputFrequencies.get(inputValue) / outputFrequencies.get(outputValue));
          }
          max[i]+=log2(inputFrequencies.get(inputValue) / (double)input.getNumRows());
          checkInterrupt();
        }
      }
      result[i]*=-1;
      max[i]*=-1;
      min[i]=0;
    }
 catch (    Exception e) {
      result[i]=Double.NaN;
      min[i]=Double.NaN;
      max[i]=Double.NaN;
      break;
    }
    checkInterrupt();
  }
  return new QualityMeasureColumnOriented(output,indices,min,result,max);
}

Fixed version (ground truth):
@Override public QualityMeasureColumnOriented evaluate(){
  int[] indices=getIndices();
  DataHandleInternal output=getOutput();
  String[][][] hierarchies=getHierarchies();
  double[] result=new double[indices.length];
  double[] min=new double[indices.length];
  double[] max=new double[indices.length];
  for (int i=0; i < result.length; i++) {
    int column=indices[i];
    try {
      Map<String,String>[] generalizationFunctions=getGeneralizationFunctions(hierarchies,i);
      Map<String,Integer> inverseGeneralizationFunction=getInverseGeneralizationFunction(hierarchies,i);
      final int[] transformations=new int[output.getNumRows()];
      for (int row=0; row < output.getNumRows(); row++) {
        transformations[row]=inverseGeneralizationFunction.get(output.getValue(row,column));
      }
      Set<Integer> _levels=new HashSet<Integer>();
      for (      int level : transformations) {
        _levels.add(level);
      }
      List<Integer> levels=new ArrayList<Integer>();
      levels.addAll(_levels);
      Collections.sort(levels);
      for (int levelIndex=0; levelIndex < levels.size(); levelIndex++) {
        int currentLevel=levels.get(levelIndex);
        int previousLevel=levelIndex > 0 ? levels.get(levelIndex - 1) : currentLevel;
        Map<String,Double> inputFrequencies=levelIndex == 0 ? getInputFrequencies(transformations,column,currentLevel) : getOutputFrequencies(transformations,generalizationFunctions,column,currentLevel,previousLevel);
        Map<String,Double> outputFrequencies=getOutputFrequencies(transformations,generalizationFunctions,column,currentLevel,currentLevel);
        DataHandleInternal input=getInput();
        for (int row=0; row < input.getNumRows(); row++) {
          String value=input.getValue(row,column);
          String inputValue=levelIndex == 0 ? value : generalizationFunctions[previousLevel].get(value);
          String outputValue=generalizationFunctions[currentLevel].get(value);
          if (transformations[row] >= currentLevel) {
            result[i]+=log2(inputFrequencies.get(inputValue) / outputFrequencies.get(outputValue));
          }
          checkInterrupt();
        }
      }
      DataHandleInternal input=getInput();
      Map<String,Double> inputFrequencies=getInputFrequencies(transformations,column,0);
      for (int row=0; row < input.getNumRows(); row++) {
        max[i]+=log2(inputFrequencies.get(input.getValue(row,column)) / (double)input.getNumRows());
      }
      result[i]*=-1;
      max[i]*=-1;
      min[i]=0;
    }
 catch (    Exception e) {
      result[i]=Double.NaN;
      min[i]=Double.NaN;
      max[i]=Double.NaN;
      break;
    }
    checkInterrupt();
  }
  return new QualityMeasureColumnOriented(output,indices,min,result,max);
}