Program: 138167
Project: 138167
Buggy source:
/** 
 * create indicatorMappings according category indicatorEnum.
 * @param categoryEnums
 * @return
 */
private IndicatorUnit[] createCategoryIndicatorUnits(IndicatorEnum[] categoryEnums){
  List<IndicatorUnit> indicatorUnitList=new ArrayList<IndicatorUnit>();
  IndicatorUnit indicatorUnit;
  for (  IndicatorEnum categoryEnum : categoryEnums) {
    if (!IndicatorEnum.isPlainIndicatorEnum(categoryEnum)) {
      continue;
    }
    indicatorUnit=getIndicatorUnit(categoryEnum);
switch (categoryEnum) {
case CountsIndicatorEnum:
      CountsIndicator countsIndicator=(CountsIndicator)indicatorUnit.getIndicator();
    countsIndicator.setBlankCountIndicator((BlankCountIndicator)getIndicatorUnit(IndicatorEnum.BlankCountIndicatorEnum).getIndicator());
  countsIndicator.setDistinctCountIndicator((DistinctCountIndicator)getIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum).getIndicator());
countsIndicator.setDuplicateCountIndicator((DuplicateCountIndicator)getIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum).getIndicator());
countsIndicator.setRowCountIndicator((RowCountIndicator)getIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum).getIndicator());
countsIndicator.setNullCountIndicator((NullCountIndicator)getIndicatorUnit(IndicatorEnum.NullCountIndicatorEnum).getIndicator());
countsIndicator.setUniqueCountIndicator((UniqueCountIndicator)getIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum).getIndicator());
countsIndicator.setDefaultValueIndicator((DefValueCountIndicator)getIndicatorUnit(IndicatorEnum.DefValueCountIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.CountsIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case TextIndicatorEnum:
TextIndicator textIndicator=(TextIndicator)indicatorUnit.getIndicator();
textIndicator.setMinLengthIndicator((MinLengthIndicator)getIndicatorUnit(IndicatorEnum.MinLengthIndicatorEnum).getIndicator());
textIndicator.setMaxLengthIndicator((MaxLengthIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthIndicatorEnum).getIndicator());
textIndicator.setAverageLengthIndicator((AverageLengthIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthIndicatorEnum).getIndicator());
textIndicator.setAvgLengthWithBlankIndicator((AvgLengthWithBlankIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthWithBlankIndicatorEnum).getIndicator());
textIndicator.setAvgLengthWithNullIndicator((AvgLengthWithNullIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthWithNullIndicatorEnum).getIndicator());
textIndicator.setAvgLengthWithBlankNullIndicator((AvgLengthWithBlankNullIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum).getIndicator());
textIndicator.setMinLengthWithBlankIndicator((MinLengthWithBlankIndicator)getIndicatorUnit(IndicatorEnum.MinLengthWithBlankIndicatorEnum).getIndicator());
textIndicator.setMinLengthWithNullIndicator((MinLengthWithNullIndicator)getIndicatorUnit(IndicatorEnum.MinLengthWithNullIndicatorEnum).getIndicator());
textIndicator.setMinLengthWithBlankNullIndicator((MinLengthWithBlankNullIndicator)getIndicatorUnit(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum).getIndicator());
textIndicator.setMaxLengthWithBlankIndicator((MaxLengthWithBlankIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthWithBlankIndicatorEnum).getIndicator());
textIndicator.setMaxLengthWithNullIndicator((MaxLengthWithNullIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthWithNullIndicatorEnum).getIndicator());
textIndicator.setMaxLengthWithBlankNullIndicator((MaxLengthWithBlankNullIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.TextIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case BoxIIndicatorEnum:
BoxIndicator boxtIndicator=(BoxIndicator)indicatorUnit.getIndicator();
boxtIndicator.setRangeIndicator((RangeIndicator)getIndicatorUnit(IndicatorEnum.RangeIndicatorEnum).getIndicator());
boxtIndicator.setIQR((IQRIndicator)getIndicatorUnit(IndicatorEnum.IQRIndicatorEnum).getIndicator());
boxtIndicator.setMeanIndicator((MeanIndicator)getIndicatorUnit(IndicatorEnum.MeanIndicatorEnum).getIndicator());
boxtIndicator.setMedianIndicator((MedianIndicator)getIndicatorUnit(IndicatorEnum.MedianIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.BoxIIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case IQRIndicatorEnum:
IQRIndicator iqrIndicator=(IQRIndicator)indicatorUnit.getIndicator();
iqrIndicator.setLowerValue((LowerQuartileIndicator)getIndicatorUnit(IndicatorEnum.LowerQuartileIndicatorEnum).getIndicator());
iqrIndicator.setUpperValue((UpperQuartileIndicator)getIndicatorUnit(IndicatorEnum.UpperQuartileIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.IQRIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case RangeIndicatorEnum:
RangeIndicator rangeIndicator=(RangeIndicator)indicatorUnit.getIndicator();
rangeIndicator.setLowerValue((MinValueIndicator)getIndicatorUnit(IndicatorEnum.MinValueIndicatorEnum).getIndicator());
rangeIndicator.setUpperValue((MaxValueIndicator)getIndicatorUnit(IndicatorEnum.MaxValueIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.RangeIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case PhoneNumbStatisticsIndicatorEnum:
PhoneNumbStatisticsIndicator phoneNumbIndicator=(PhoneNumbStatisticsIndicator)indicatorUnit.getIndicator();
phoneNumbIndicator.setValidPhoneCountIndicator((ValidPhoneCountIndicator)getIndicatorUnit(IndicatorEnum.ValidPhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setPossiblePhoneCountIndicator((PossiblePhoneCountIndicator)getIndicatorUnit(IndicatorEnum.PossiblePhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setValidRegCodeCountIndicator((ValidRegCodeCountIndicator)getIndicatorUnit(IndicatorEnum.ValidRegCodeCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setInvalidRegCodeCountIndicator((InvalidRegCodeCountIndicator)getIndicatorUnit(IndicatorEnum.InvalidRegCodeCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setWellFormE164PhoneCountIndicator((WellFormE164PhoneCountIndicator)getIndicatorUnit(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setWellFormIntePhoneCountIndicator((WellFormIntePhoneCountIndicatorImpl)getIndicatorUnit(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setWellFormNationalPhoneCountIndicator((WellFormNationalPhoneCountIndicatorImpl)getIndicatorUnit(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setFormatFreqPieIndicator((FormatFreqPieIndicatorImpl)getIndicatorUnit(IndicatorEnum.FormatFreqPieIndictorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
default :
indicatorUnitList.add(indicatorUnit);
break;
}
}
return indicatorUnitList.toArray(new IndicatorUnit[indicatorUnitList.size()]);
}

Fixed version (ground truth):
/** 
 * create indicatorMappings according category indicatorEnum.
 * @param categoryEnums
 * @return
 */
private IndicatorUnit[] createCategoryIndicatorUnits(IndicatorEnum[] categoryEnums){
  List<IndicatorUnit> indicatorUnitList=new ArrayList<IndicatorUnit>();
  IndicatorUnit indicatorUnit;
  for (  IndicatorEnum categoryEnum : categoryEnums) {
    if (null == categoryEnum) {
      continue;
    }
    if (!IndicatorEnum.isPlainIndicatorEnum(categoryEnum)) {
      continue;
    }
    indicatorUnit=getIndicatorUnit(categoryEnum);
switch (categoryEnum) {
case CountsIndicatorEnum:
      CountsIndicator countsIndicator=(CountsIndicator)indicatorUnit.getIndicator();
    countsIndicator.setBlankCountIndicator((BlankCountIndicator)getIndicatorUnit(IndicatorEnum.BlankCountIndicatorEnum).getIndicator());
  countsIndicator.setDistinctCountIndicator((DistinctCountIndicator)getIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum).getIndicator());
countsIndicator.setDuplicateCountIndicator((DuplicateCountIndicator)getIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum).getIndicator());
countsIndicator.setRowCountIndicator((RowCountIndicator)getIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum).getIndicator());
countsIndicator.setNullCountIndicator((NullCountIndicator)getIndicatorUnit(IndicatorEnum.NullCountIndicatorEnum).getIndicator());
countsIndicator.setUniqueCountIndicator((UniqueCountIndicator)getIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum).getIndicator());
countsIndicator.setDefaultValueIndicator((DefValueCountIndicator)getIndicatorUnit(IndicatorEnum.DefValueCountIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.CountsIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case TextIndicatorEnum:
TextIndicator textIndicator=(TextIndicator)indicatorUnit.getIndicator();
textIndicator.setMinLengthIndicator((MinLengthIndicator)getIndicatorUnit(IndicatorEnum.MinLengthIndicatorEnum).getIndicator());
textIndicator.setMaxLengthIndicator((MaxLengthIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthIndicatorEnum).getIndicator());
textIndicator.setAverageLengthIndicator((AverageLengthIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthIndicatorEnum).getIndicator());
textIndicator.setAvgLengthWithBlankIndicator((AvgLengthWithBlankIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthWithBlankIndicatorEnum).getIndicator());
textIndicator.setAvgLengthWithNullIndicator((AvgLengthWithNullIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthWithNullIndicatorEnum).getIndicator());
textIndicator.setAvgLengthWithBlankNullIndicator((AvgLengthWithBlankNullIndicator)getIndicatorUnit(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum).getIndicator());
textIndicator.setMinLengthWithBlankIndicator((MinLengthWithBlankIndicator)getIndicatorUnit(IndicatorEnum.MinLengthWithBlankIndicatorEnum).getIndicator());
textIndicator.setMinLengthWithNullIndicator((MinLengthWithNullIndicator)getIndicatorUnit(IndicatorEnum.MinLengthWithNullIndicatorEnum).getIndicator());
textIndicator.setMinLengthWithBlankNullIndicator((MinLengthWithBlankNullIndicator)getIndicatorUnit(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum).getIndicator());
textIndicator.setMaxLengthWithBlankIndicator((MaxLengthWithBlankIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthWithBlankIndicatorEnum).getIndicator());
textIndicator.setMaxLengthWithNullIndicator((MaxLengthWithNullIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthWithNullIndicatorEnum).getIndicator());
textIndicator.setMaxLengthWithBlankNullIndicator((MaxLengthWithBlankNullIndicator)getIndicatorUnit(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.TextIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case BoxIIndicatorEnum:
BoxIndicator boxtIndicator=(BoxIndicator)indicatorUnit.getIndicator();
boxtIndicator.setRangeIndicator((RangeIndicator)getIndicatorUnit(IndicatorEnum.RangeIndicatorEnum).getIndicator());
boxtIndicator.setIQR((IQRIndicator)getIndicatorUnit(IndicatorEnum.IQRIndicatorEnum).getIndicator());
boxtIndicator.setMeanIndicator((MeanIndicator)getIndicatorUnit(IndicatorEnum.MeanIndicatorEnum).getIndicator());
boxtIndicator.setMedianIndicator((MedianIndicator)getIndicatorUnit(IndicatorEnum.MedianIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.BoxIIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case IQRIndicatorEnum:
IQRIndicator iqrIndicator=(IQRIndicator)indicatorUnit.getIndicator();
iqrIndicator.setLowerValue((LowerQuartileIndicator)getIndicatorUnit(IndicatorEnum.LowerQuartileIndicatorEnum).getIndicator());
iqrIndicator.setUpperValue((UpperQuartileIndicator)getIndicatorUnit(IndicatorEnum.UpperQuartileIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.IQRIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case RangeIndicatorEnum:
RangeIndicator rangeIndicator=(RangeIndicator)indicatorUnit.getIndicator();
rangeIndicator.setLowerValue((MinValueIndicator)getIndicatorUnit(IndicatorEnum.MinValueIndicatorEnum).getIndicator());
rangeIndicator.setUpperValue((MaxValueIndicator)getIndicatorUnit(IndicatorEnum.MaxValueIndicatorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.RangeIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
case PhoneNumbStatisticsIndicatorEnum:
PhoneNumbStatisticsIndicator phoneNumbIndicator=(PhoneNumbStatisticsIndicator)indicatorUnit.getIndicator();
phoneNumbIndicator.setValidPhoneCountIndicator((ValidPhoneCountIndicator)getIndicatorUnit(IndicatorEnum.ValidPhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setPossiblePhoneCountIndicator((PossiblePhoneCountIndicator)getIndicatorUnit(IndicatorEnum.PossiblePhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setValidRegCodeCountIndicator((ValidRegCodeCountIndicator)getIndicatorUnit(IndicatorEnum.ValidRegCodeCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setInvalidRegCodeCountIndicator((InvalidRegCodeCountIndicator)getIndicatorUnit(IndicatorEnum.InvalidRegCodeCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setWellFormE164PhoneCountIndicator((WellFormE164PhoneCountIndicator)getIndicatorUnit(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setWellFormIntePhoneCountIndicator((WellFormIntePhoneCountIndicatorImpl)getIndicatorUnit(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setWellFormNationalPhoneCountIndicator((WellFormNationalPhoneCountIndicatorImpl)getIndicatorUnit(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum).getIndicator());
phoneNumbIndicator.setFormatFreqPieIndicator((FormatFreqPieIndicatorImpl)getIndicatorUnit(IndicatorEnum.FormatFreqPieIndictorEnum).getIndicator());
indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum.getChildren()));
indicatorUnitList.add(indicatorUnit);
break;
default :
indicatorUnitList.add(indicatorUnit);
break;
}
}
return indicatorUnitList.toArray(new IndicatorUnit[indicatorUnitList.size()]);
}