Program: 140509
Project: 140509
Buggy source:
private static ChartDataEntity[] getDataEnityFromUnits(List<IndicatorUnit> unitList){
  List<ChartDataEntity> list=new ArrayList<ChartDataEntity>();
  for (  IndicatorUnit unit : unitList) {
    if (unit.getType() == IndicatorEnum.FrequencyIndicatorEnum) {
      FrequencyExt[] freqExt=(FrequencyExt[])unit.getValue();
      for (      FrequencyExt one : freqExt) {
        ChartDataEntity entity=new ChartDataEntity();
        entity.setLabel(one.getKey().toString());
        entity.setValue(one.getValue().toString());
        entity.setIndicator(unit.getIndicator());
        list.add(entity);
      }
    }
 else     if (unit.getType() == IndicatorEnum.RegexpMatchingIndicatorEnum || unit.getType() == IndicatorEnum.SqlPatternMatchingIndicatorEnum) {
      PatternMatchingExt patnExt=(PatternMatchingExt)unit.getValue();
      PatternChartDataEntity entity=new PatternChartDataEntity();
      entity.setLabel(unit.getIndicatorName());
      entity.setNumMatch(String.valueOf(patnExt.getMatchingValueCount()));
      entity.setNumNoMatch(String.valueOf(patnExt.getNotMatchingValueCount()));
      entity.setIndicator(unit.getIndicator());
      list.add(entity);
    }
 else {
      ChartDataEntity entity=new ChartDataEntity();
      entity.setLabel(unit.getIndicatorName());
      entity.setValue(unit.getValue().toString());
      entity.setIndicator(unit.getIndicator());
      list.add(entity);
    }
  }
  return list.toArray(new ChartDataEntity[list.size()]);
}

Fixed version (ground truth):
private static ChartDataEntity[] getDataEnityFromUnits(List<IndicatorUnit> unitList){
  List<ChartDataEntity> list=new ArrayList<ChartDataEntity>();
  for (  IndicatorUnit unit : unitList) {
    if (unit.getType() == IndicatorEnum.FrequencyIndicatorEnum) {
      FrequencyExt[] freqExt=(FrequencyExt[])unit.getValue();
      for (      FrequencyExt one : freqExt) {
        ChartDataEntity entity=new ChartDataEntity();
        entity.setLabel(one.getKey().toString());
        entity.setValue(one.getValue().toString());
        entity.setPercent(one.getFrequency().toString());
        entity.setIndicator(unit.getIndicator());
        list.add(entity);
      }
      ChartDataEntity entity=new ChartDataEntity();
      FrequencyIndicator freqIndicator=(FrequencyIndicator)unit.getIndicator();
      entity.setLabel(FrequencyIndicator.OTHER);
      entity.setValue(freqIndicator.getCount(FrequencyIndicator.OTHER).toString());
      entity.setPercent(freqIndicator.getFrequency(FrequencyIndicator.OTHER).toString());
      entity.setIndicator(freqIndicator);
      list.add(entity);
    }
 else     if (unit.getType() == IndicatorEnum.RegexpMatchingIndicatorEnum || unit.getType() == IndicatorEnum.SqlPatternMatchingIndicatorEnum) {
      PatternMatchingExt patnExt=(PatternMatchingExt)unit.getValue();
      PatternChartDataEntity entity=new PatternChartDataEntity();
      entity.setLabel(unit.getIndicatorName());
      entity.setNumMatch(String.valueOf(patnExt.getMatchingValueCount()));
      entity.setNumNoMatch(String.valueOf(patnExt.getNotMatchingValueCount()));
      entity.setIndicator(unit.getIndicator());
      list.add(entity);
    }
 else {
      ChartDataEntity entity=new ChartDataEntity();
      entity.setLabel(unit.getIndicatorName());
      entity.setValue(unit.getValue().toString());
      entity.setIndicator(unit.getIndicator());
      list.add(entity);
    }
  }
  return list.toArray(new ChartDataEntity[list.size()]);
}