Program: 31641
Project: 31641
Buggy source:
/** 
 * Create @DerivedField for numerical variable
 * @param config - ColumnConfig for numerical variable
 * @param cutoff - cutoff of normalization
 * @param normType - the normalization method that is used to generate DerivedField
 * @return DerivedField for variable
 */
@Override protected List<DerivedField> createNumericalDerivedField(ColumnConfig config,double cutoff,ModelNormalizeConf.NormType normType){
  List<Double> binWoeList=(normType.equals(ModelNormalizeConf.NormType.WOE) ? config.getBinCountWoe() : config.getBinWeightedWoe());
  List<Double> binBoundaryList=config.getBinBoundary();
  List<DiscretizeBin> discretizeBinList=new ArrayList<DiscretizeBin>();
  for (int i=0; i < binBoundaryList.size(); i++) {
    DiscretizeBin discretizeBin=new DiscretizeBin();
    Interval interval=new Interval();
    if (i == 0) {
      if (binBoundaryList.size() == 1) {
        interval.withClosure(Interval.Closure.OPEN_OPEN).withLeftMargin(Double.NEGATIVE_INFINITY).withRightMargin(Double.POSITIVE_INFINITY);
      }
 else {
        interval.withClosure(Interval.Closure.OPEN_OPEN).withRightMargin(binBoundaryList.get(i + 1));
      }
    }
 else     if (i == binBoundaryList.size() - 1) {
      interval.withClosure(Interval.Closure.CLOSED_OPEN).withLeftMargin(binBoundaryList.get(i));
    }
 else {
      interval.withClosure(Interval.Closure.CLOSED_OPEN).withLeftMargin(binBoundaryList.get(i)).withRightMargin(binBoundaryList.get(i + 1));
    }
    discretizeBin.withInterval(interval).withBinValue(Double.toString(binWoeList.get(i)));
    discretizeBinList.add(discretizeBin);
  }
  Discretize discretize=new Discretize();
  discretize.withDataType(DataType.DOUBLE).withField(FieldName.create(CommonUtils.getSimpleColumnName(config))).withMapMissingTo(Normalizer.normalize(config,null,cutoff,normType).toString()).withDefaultValue(Normalizer.normalize(config,null,cutoff,normType).toString()).withDiscretizeBins(discretizeBinList);
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(CommonUtils.getSimpleColumnName(config),normType))).withExpression(discretize));
  return derivedFields;
}

Fixed version (ground truth):
/** 
 * Create @DerivedField for numerical variable
 * @param config - ColumnConfig for numerical variable
 * @param cutoff - cutoff of normalization
 * @param normType - the normalization method that is used to generate DerivedField
 * @return DerivedField for variable
 */
@Override protected List<DerivedField> createNumericalDerivedField(ColumnConfig config,double cutoff,ModelNormalizeConf.NormType normType){
  List<Double> binWoeList=(normType.equals(ModelNormalizeConf.NormType.WOE) ? config.getBinCountWoe() : config.getBinWeightedWoe());
  List<Double> binBoundaryList=config.getBinBoundary();
  List<DiscretizeBin> discretizeBinList=new ArrayList<DiscretizeBin>();
  for (int i=0; i < binBoundaryList.size(); i++) {
    DiscretizeBin discretizeBin=new DiscretizeBin();
    Interval interval=new Interval();
    if (i == 0) {
      if (binBoundaryList.size() == 1) {
        interval.withClosure(Interval.Closure.OPEN_OPEN).withLeftMargin(Double.NEGATIVE_INFINITY).withRightMargin(Double.POSITIVE_INFINITY);
      }
 else {
        interval.withClosure(Interval.Closure.OPEN_OPEN).withRightMargin(binBoundaryList.get(i + 1));
      }
    }
 else     if (i == binBoundaryList.size() - 1) {
      interval.withClosure(Interval.Closure.CLOSED_OPEN).withLeftMargin(binBoundaryList.get(i));
    }
 else {
      interval.withClosure(Interval.Closure.CLOSED_OPEN).withLeftMargin(binBoundaryList.get(i)).withRightMargin(binBoundaryList.get(i + 1));
    }
    discretizeBin.withInterval(interval).withBinValue(Double.toString(binWoeList.get(i)));
    discretizeBinList.add(discretizeBin);
  }
  Discretize discretize=new Discretize();
  discretize.withDataType(DataType.DOUBLE).withField(FieldName.create(CommonUtils.getSimpleColumnName(config))).withMapMissingTo(Normalizer.normalize(config,null,cutoff,normType).get(0).toString()).withDefaultValue(Normalizer.normalize(config,null,cutoff,normType).get(0).toString()).withDiscretizeBins(discretizeBinList);
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(CommonUtils.getSimpleColumnName(config),normType))).withExpression(discretize));
  return derivedFields;
}