Program: 32038
Project: 32038
Buggy source:
/** 
 * Create @DerivedField for numerical variable
 * @param config - ColumnConfig for numerical variable
 * @param cutoff - cutoff of normalization
 * @return DerivedField for variable
 */
protected List<DerivedField> createNumericalDerivedField(ColumnConfig config,double cutoff){
  ModelNormalizeConf.NormType normType=this.modelConfig.getNormalizeType();
  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) {
      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(config.getColumnName())).withMapMissingTo(Normalizer.normalize(config,null,cutoff,this.modelConfig.getNormalizeType()).toString()).withDefaultValue(Normalizer.normalize(config,null,cutoff,this.modelConfig.getNormalizeType()).toString()).withDiscretizeBins(discretizeBinList);
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(config.getColumnName()))).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(config.getColumnName())).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(config.getColumnName(),normType))).withExpression(discretize));
  return derivedFields;
}