Program: 107851
Project: 107851
Buggy source:
@Override public UtilityMeasureColumnOriented evaluate(final DataHandleInternal output){
  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=getHelper().getGeneralizationFunctions(hierarchies,i);
      Map<String,Integer> inverseGeneralizationFunction=getHelper().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[levels.get(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;
      min[i]=0;
    }
 catch (    Exception e) {
      result[i]=Double.NaN;
      min[i]=Double.NaN;
      max[i]=Double.NaN;
      break;
    }
    checkInterrupt();
  }
  return new UtilityMeasureColumnOriented(output,indices,min,result,max);
}

Fixed version (ground truth):
@Override public UtilityMeasureColumnOriented evaluate(final DataHandleInternal output){
  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=getHelper().getGeneralizationFunctions(hierarchies,i);
      Map<String,Integer> inverseGeneralizationFunction=getHelper().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[levels.get(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 UtilityMeasureColumnOriented(output,indices,min,result,max);
}