Program: 32040
Project: 32040
Buggy source:
/** 
 * Create @DerivedField for categorical variable
 * @param config - ColumnConfig for categorical variable
 * @param cutoff - cutoff for normalization
 * @return DerivedField for variable
 */
protected List<DerivedField> createCategoricalDerivedField(ColumnConfig config,double cutoff){
  Document document=null;
  try {
    document=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  }
 catch (  ParserConfigurationException e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException("String_Node_Str",e);
  }
  String defaultValue=Normalizer.normalize(config,"String_Node_Str",cutoff,this.modelConfig.getNormalizeType()).toString();
  String missingValue=Normalizer.normalize(config,null,cutoff,this.modelConfig.getNormalizeType()).toString();
  InlineTable inlineTable=new InlineTable();
  for (int i=0; i < config.getBinCategory().size(); i++) {
    String cval=config.getBinCategory().get(i);
    String dval=Normalizer.normalize(config,cval,cutoff,this.modelConfig.getNormalizeType()).toString();
    Element out=document.createElementNS(NAME_SPACE_URI,ELEMENT_OUT);
    out.setTextContent(dval);
    Element origin=document.createElementNS(NAME_SPACE_URI,ELEMENT_ORIGIN);
    origin.setTextContent(cval);
    inlineTable.withRows(new Row().withContent(origin).withContent(out));
  }
  MapValues mapValues=new MapValues("String_Node_Str").withDataType(DataType.DOUBLE).withDefaultValue(defaultValue).withFieldColumnPairs(new FieldColumnPair(new FieldName(config.getColumnName()),ELEMENT_ORIGIN)).withInlineTable(inlineTable).withMapMissingTo(missingValue);
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(config.getColumnName()))).withExpression(mapValues));
  return derivedFields;
}

Fixed version (ground truth):
/** 
 * Create @DerivedField for categorical variable
 * @param config - ColumnConfig for categorical variable
 * @param cutoff - cutoff for normalization
 * @param normType - the normalization method that is used to generate DerivedField
 * @return DerivedField for variable
 */
protected List<DerivedField> createCategoricalDerivedField(ColumnConfig config,double cutoff,ModelNormalizeConf.NormType normType){
  Document document=null;
  try {
    document=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  }
 catch (  ParserConfigurationException e) {
    LOG.error("String_Node_Str",e);
    throw new RuntimeException("String_Node_Str",e);
  }
  String defaultValue=Normalizer.normalize(config,"String_Node_Str",cutoff,normType).toString();
  String missingValue=Normalizer.normalize(config,null,cutoff,normType).toString();
  InlineTable inlineTable=new InlineTable();
  for (int i=0; i < config.getBinCategory().size(); i++) {
    String cval=config.getBinCategory().get(i);
    String dval=Normalizer.normalize(config,cval,cutoff,normType).toString();
    Element out=document.createElementNS(NAME_SPACE_URI,ELEMENT_OUT);
    out.setTextContent(dval);
    Element origin=document.createElementNS(NAME_SPACE_URI,ELEMENT_ORIGIN);
    origin.setTextContent(cval);
    inlineTable.withRows(new Row().withContent(origin).withContent(out));
  }
  MapValues mapValues=new MapValues("String_Node_Str").withDataType(DataType.DOUBLE).withDefaultValue(defaultValue).withFieldColumnPairs(new FieldColumnPair(new FieldName(config.getColumnName()),ELEMENT_ORIGIN)).withInlineTable(inlineTable).withMapMissingTo(missingValue);
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(config.getColumnName(),normType))).withExpression(mapValues));
  return derivedFields;
}