nus-yam/ex-repair huggingface dataset:
Program: 31972
Project: 31972
Buggy source:
private void postProcessFIVarSelect(Map<Integer,MutablePair<String,Double>> importances){
  int selectCnt=0;
  for (  ColumnConfig config : super.columnConfigList) {
    if (config.isFinalSelect()) {
      config.setFinalSelect(false);
    }
    if (config.isForceSelect()) {
      config.setFinalSelect(true);
      selectCnt++;
      log.info("String_Node_Str",config.getColumnName());
    }
  }
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(this.columnConfigList);
  int inputNodeCount=inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0];
  Float wrapperRatio=this.modelConfig.getVarSelect().getWrapperRatio();
  int targetCnt=(int)(inputNodeCount * (1.0f - wrapperRatio));
  List<Integer> candidateColumnIdList=new ArrayList<Integer>();
  candidateColumnIdList.addAll(importances.keySet());
  int i=0;
  while (selectCnt < targetCnt && i < targetCnt) {
    Integer columnId=candidateColumnIdList.get(i++);
    ColumnConfig columnConfig=this.columnConfigList.get(columnId);
    if (!columnConfig.isForceSelect() && !columnConfig.isForceRemove()) {
      columnConfig.setFinalSelect(true);
      selectCnt++;
      log.info("String_Node_Str",columnConfig.getColumnName());
    }
  }
  log.info("String_Node_Str",selectCnt);
}

Fixed version (ground truth):
private void postProcessFIVarSelect(Map<Integer,MutablePair<String,Double>> importances){
  int selectCnt=0;
  for (  ColumnConfig config : super.columnConfigList) {
    if (config.isForceSelect()) {
      config.setFinalSelect(true);
      selectCnt++;
      log.info("String_Node_Str",config.getColumnName());
    }
  }
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(this.columnConfigList);
  int inputNodeCount=inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0];
  Float wrapperRatio=this.modelConfig.getVarSelect().getWrapperRatio();
  int targetCnt=(int)(inputNodeCount * (1.0f - wrapperRatio));
  List<Integer> candidateColumnIdList=new ArrayList<Integer>();
  candidateColumnIdList.addAll(importances.keySet());
  int i=0;
  while (selectCnt < targetCnt && i < targetCnt) {
    Integer columnId=candidateColumnIdList.get(i++);
    ColumnConfig columnConfig=this.columnConfigList.get(columnId);
    if (!columnConfig.isForceSelect() && !columnConfig.isForceRemove()) {
      columnConfig.setFinalSelect(true);
      selectCnt++;
      log.info("String_Node_Str",columnConfig.getColumnName());
    }
  }
  log.info("String_Node_Str",selectCnt);
}
Program: 31974
Project: 31974
Buggy source:
/** 
 * @param evalSetName
 * @param isDryRun
 * @throws Exception
 */
public static int runEvalSet(String evalSetName,boolean isDryRun) throws Exception {
  EvalModelProcessor p=new EvalModelProcessor(EvalStep.RUN,evalSetName);
  return p.run();
}

Fixed version (ground truth):
/** 
 * @param evalSetName
 * @param isDryRun
 * @throws Exception
 */
public static int runEvalSet(String evalSetName,boolean isDryRun) throws Exception {
  log.info("String_Node_Str",evalSetName);
  EvalModelProcessor p=new EvalModelProcessor(EvalStep.RUN,evalSetName);
  return p.run();
}
Program: 31975
Project: 31975
Buggy source:
public String genFieldSelector(){
  List<String> fields=new ArrayList<String>();
  for (  String var : selectedVars) {
    if (this.varsMapping.containsKey(var)) {
      fields.add(var + "String_Node_Str" + this.varsMapping.get(var));
    }
 else {
      fields.add(var);
    }
  }
  return StringUtils.join(fields,"String_Node_Str");
}

Fixed version (ground truth):
public String genFieldSelector(){
  List<String> fields=new ArrayList<String>();
  for (  String var : selectedVars) {
    if (this.varsMapping.containsKey(var)) {
      fields.add(var + "String_Node_Str" + this.varsMapping.get(var));
    }
 else {
      fields.add(var + "String_Node_Str" + var);
    }
  }
  return StringUtils.join(fields,"String_Node_Str");
}
Program: 31976
Project: 31976
Buggy source:
public void join(String uidColumnName,String outputPath,List<ColumnFile> columnFileList) throws IOException {
  String pigCode=genPigJoinCode(uidColumnName,outputPath,columnFileList);
  PigExecutor.getExecutor().submitJob(RawSourceData.SourceType.HDFS,pigCode);
}

Fixed version (ground truth):
public void join(String uidColumnName,String outputPath,List<ColumnFile> columnFileList) throws IOException {
  String pigCode=genPigJoinCode(uidColumnName,outputPath,columnFileList);
  LOG.debug("String_Node_Str" + pigCode);
  PigExecutor.getExecutor().submitJob(RawSourceData.SourceType.HDFS,pigCode);
}
Program: 31977
Project: 31977
Buggy source:
public String genPigJoinCode(String uidColumnName,String outputPath,List<ColumnFile> columnFileList) throws IOException {
  ByteArrayOutputStream byos=new ByteArrayOutputStream();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(byos));
  try {
    List<String> relations=new ArrayList<String>();
    int i=0;
    for (    ColumnFile columnFile : columnFileList) {
      String relation=DATA_PREFIX + (i++);
      writeLine(writer,relation + "String_Node_Str" + columnFile.getFilePath()+ "String_Node_Str");
      if (columnFile.hasSelectedVar(uidColumnName)) {
        writeLine(writer,relation + "String_Node_Str" + relation+ "String_Node_Str"+ columnFile.genFieldSelector()+ "String_Node_Str");
      }
 else {
        writeLine(writer,relation + "String_Node_Str" + relation+ "String_Node_Str"+ uidColumnName+ "String_Node_Str"+ columnFile.genFieldSelector()+ "String_Node_Str");
      }
      relations.add(relation);
    }
    writeLine(writer,"String_Node_Str" + genGroupByClauses(relations,uidColumnName) + "String_Node_Str");
    writeLine(writer,"String_Node_Str" + genFlattenClauses(relations) + "String_Node_Str");
    writeLine(writer,"String_Node_Str" + genRenameClauses(columnFileList,relations));
    writeLine(writer,"String_Node_Str" + outputPath + "String_Node_Str");
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    throw e;
  }
 finally {
    IOUtils.closeQuietly(writer);
    IOUtils.closeQuietly(byos);
  }
  return byos.toString();
}

Fixed version (ground truth):
public String genPigJoinCode(String uidColumnName,String outputPath,List<ColumnFile> columnFileList) throws IOException {
  ByteArrayOutputStream byos=new ByteArrayOutputStream();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(byos));
  try {
    List<String> relations=new ArrayList<String>();
    int i=0;
    for (    ColumnFile columnFile : columnFileList) {
      String relation=DATA_PREFIX + (i++);
      writeLine(writer,relation + "String_Node_Str" + columnFile.getFilePath()+ "String_Node_Str");
      if (columnFile.hasSelectedVar(uidColumnName)) {
        writeLine(writer,relation + "String_Node_Str" + relation+ "String_Node_Str"+ columnFile.genFieldSelector()+ "String_Node_Str");
      }
 else {
        writeLine(writer,relation + "String_Node_Str" + relation+ "String_Node_Str"+ uidColumnName+ "String_Node_Str"+ uidColumnName+ "String_Node_Str"+ columnFile.genFieldSelector()+ "String_Node_Str");
      }
      relations.add(relation);
    }
    writeLine(writer,"String_Node_Str" + genGroupByClauses(relations,uidColumnName) + "String_Node_Str");
    writeLine(writer,"String_Node_Str" + genFlattenClauses(relations) + "String_Node_Str");
    writeLine(writer,"String_Node_Str" + genRenameClauses(columnFileList,relations) + "String_Node_Str");
    writeLine(writer,"String_Node_Str" + outputPath + "String_Node_Str");
    writeLine(writer,"String_Node_Str" + outputPath + "String_Node_Str");
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    throw e;
  }
 finally {
    IOUtils.closeQuietly(writer);
    IOUtils.closeQuietly(byos);
  }
  return byos.toString();
}
Program: 31978
Project: 31978
Buggy source:
private Map<Integer,Data> getCountInfoMap(SourceType source,String autoTypePath) throws IOException {
  String outputFilePattern=autoTypePath + Path.SEPARATOR + "String_Node_Str";
  if (!ShifuFileUtils.isFileExists(outputFilePattern,source)) {
    throw new RuntimeException("String_Node_Str");
  }
  Map<Integer,Data> distinctCountMap=new HashMap<Integer,Data>();
  List<Scanner> scanners=null;
  try {
    FileStatus[] globStatus=ShifuFileUtils.getFileSystemBySourceType(source).globStatus(new Path(outputFilePattern));
    if (globStatus == null || globStatus.length == 0) {
      throw new RuntimeException("String_Node_Str");
    }
    scanners=ShifuFileUtils.getDataScanners(globStatus[0].getPath().toString(),source);
    Scanner scanner=scanners.get(0);
    String str=null;
    while (scanner.hasNext()) {
      str=scanner.nextLine().trim();
      if (str.contains(TAB_STR)) {
        String[] splits1=str.split(TAB_STR);
        String[] splits2=splits1[1].split("String_Node_Str");
        distinctCountMap.put(Integer.valueOf(splits1[0]),new Data(Long.valueOf(splits2[0]),Long.valueOf(splits2[1]),Long.valueOf(splits2[2]),Long.valueOf(splits2[3]),splits2[4].split("String_Node_Str")));
      }
    }
    return distinctCountMap;
  }
  finally {
    if (scanners != null) {
      for (      Scanner scanner : scanners) {
        if (scanner != null) {
          scanner.close();
        }
      }
    }
  }
}

Fixed version (ground truth):
private Map<Integer,Data> getCountInfoMap(SourceType source,String autoTypePath) throws IOException {
  String outputFilePattern=autoTypePath + Path.SEPARATOR + "String_Node_Str";
  if (!ShifuFileUtils.isFileExists(outputFilePattern,source)) {
    throw new RuntimeException("String_Node_Str");
  }
  Map<Integer,Data> distinctCountMap=new HashMap<Integer,Data>();
  List<Scanner> scanners=null;
  try {
    FileStatus[] globStatus=ShifuFileUtils.getFileSystemBySourceType(source).globStatus(new Path(outputFilePattern));
    if (globStatus == null || globStatus.length == 0) {
      throw new RuntimeException("String_Node_Str");
    }
    scanners=ShifuFileUtils.getDataScanners(globStatus[0].getPath().toString(),source);
    Scanner scanner=scanners.get(0);
    String str=null;
    while (scanner.hasNext()) {
      str=scanner.nextLine().trim();
      if (str.contains(TAB_STR)) {
        String[] splits1=str.split(TAB_STR);
        String[] splits2=splits1[1].split("String_Node_Str",-1);
        distinctCountMap.put(Integer.valueOf(splits1[0]),new Data(Long.valueOf(splits2[0]),Long.valueOf(splits2[1]),Long.valueOf(splits2[2]),Long.valueOf(splits2[3]),splits2[4].split("String_Node_Str")));
      }
    }
    return distinctCountMap;
  }
  finally {
    if (scanners != null) {
      for (      Scanner scanner : scanners) {
        if (scanner != null) {
          scanner.close();
        }
      }
    }
  }
}
Program: 31982
Project: 31982
Buggy source:
@Override public Schema outputSchema(Schema input){
  try {
    Schema tupleSchema=new Schema();
    tupleSchema.add(new FieldSchema("String_Node_Str",DataType.INTEGER));
    tupleSchema.add(new FieldSchema("String_Node_Str",DataType.CHARARRAY));
    tupleSchema.add(new FieldSchema("String_Node_Str",DataType.BOOLEAN));
    if (this.isAppendRandom) {
      tupleSchema.add(new FieldSchema("String_Node_Str",DataType.INTEGER));
    }
    return new Schema(new Schema.FieldSchema("String_Node_Str",new Schema(new Schema.FieldSchema("String_Node_Str",tupleSchema,DataType.TUPLE)),DataType.BAG));
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
@Override public Schema outputSchema(Schema input){
  try {
    Schema tupleSchema=new Schema();
    tupleSchema.add(new FieldSchema("String_Node_Str",DataType.INTEGER));
    tupleSchema.add(new FieldSchema("String_Node_Str",DataType.CHARARRAY));
    tupleSchema.add(new FieldSchema("String_Node_Str",DataType.BOOLEAN));
    if (this.isAppendRandom) {
      tupleSchema.add(new FieldSchema("String_Node_Str",DataType.INTEGER));
    }
    tupleSchema.add(new FieldSchema("String_Node_Str",DataType.DOUBLE));
    return new Schema(new Schema.FieldSchema("String_Node_Str",new Schema(new Schema.FieldSchema("String_Node_Str",tupleSchema,DataType.TUPLE)),DataType.BAG));
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    return null;
  }
}
Program: 31983
Project: 31983
Buggy source:
public AddColumnNumAndFilterUDF(String source,String pathModelConfig,String pathColumnConfig,String withScoreStr,String isAppendRandom) throws Exception {
  super(source,pathModelConfig,pathColumnConfig);
  this.isAppendRandom=Boolean.TRUE.toString().equalsIgnoreCase(isAppendRandom);
}

Fixed version (ground truth):
public AddColumnNumAndFilterUDF(String source,String pathModelConfig,String pathColumnConfig,String withScoreStr,String isAppendRandom) throws Exception {
  super(source,pathModelConfig,pathColumnConfig,withScoreStr);
  this.isAppendRandom=Boolean.TRUE.toString().equalsIgnoreCase(isAppendRandom);
}
Program: 31988
Project: 31988
Buggy source:
@Override public Void process() throws IOException {
  LOG.info("String_Node_Str");
  JSONUtils.writeValue(new File(pathFinder.getModelConfigPath(SourceType.LOCAL)),modelConfig);
  JSONUtils.writeValue(new File(pathFinder.getColumnConfigPath(SourceType.LOCAL)),columnConfigList);
  EvalModelProcessor processor=new EvalModelProcessor(EvalStep.RUN);
  try {
    processor.run();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@Override public Void process() throws IOException {
  LOG.info("String_Node_Str");
  JSONUtils.writeValue(new File(pathFinder.getModelConfigPath(SourceType.LOCAL)),modelConfig);
  JSONUtils.writeValue(new File(pathFinder.getColumnConfigPath(SourceType.LOCAL)),columnConfigList);
  EvalModelProcessor processor=new EvalModelProcessor(EvalStep.RUN,super.otherConfigs);
  try {
    processor.run();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return null;
}
Program: 31989
Project: 31989
Buggy source:
public BasicModelProcessor(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,Map<String,Object> otherConfigs){
  this.modelConfig=modelConfig;
  this.columnConfigList=columnConfigList;
  this.otherConfigs=otherConfigs;
  this.pathFinder=new PathFinder(modelConfig,otherConfigs);
}

Fixed version (ground truth):
public BasicModelProcessor(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,Map<String,Object> otherConfigs){
  this.modelConfig=modelConfig;
  this.columnConfigList=columnConfigList;
  this.setOtherConfigs(otherConfigs);
  this.pathFinder=new PathFinder(modelConfig,otherConfigs);
}
Program: 31990
Project: 31990
Buggy source:
/** 
 * initialize the config file, pathFinder and other input
 * @param step Shifu running step
 * @throws Exception
 */
protected void setUp(ModelStep step) throws Exception {
  if (hasInitialized()) {
    return;
  }
  loadModelConfig();
  validateModelConfig(step);
  pathFinder=new PathFinder(modelConfig,this.otherConfigs);
  checkAlgorithmParam();
  log.info(String.format("String_Node_Str",modelConfig.getDataSet().getSource()));
switch (step) {
case INIT:
    break;
default :
  loadColumnConfig();
validateColumnConfig();
break;
}
}

Fixed version (ground truth):
/** 
 * initialize the config file, pathFinder and other input
 * @param step Shifu running step
 * @throws Exception
 */
protected void setUp(ModelStep step) throws Exception {
  if (hasInitialized()) {
    return;
  }
  loadModelConfig();
  validateModelConfig(step);
  pathFinder=new PathFinder(modelConfig,this.getOtherConfigs());
  checkAlgorithmParam();
  log.info(String.format("String_Node_Str",modelConfig.getDataSet().getSource()));
switch (step) {
case INIT:
    break;
default :
  loadColumnConfig();
validateColumnConfig();
break;
}
}
Program: 31992
Project: 31992
Buggy source:
@Override public Void process() throws IOException {
  LOG.info("String_Node_Str");
  JSONUtils.writeValue(new File(pathFinder.getModelConfigPath(SourceType.LOCAL)),modelConfig);
  JSONUtils.writeValue(new File(pathFinder.getColumnConfigPath(SourceType.LOCAL)),columnConfigList);
  TrainModelProcessor processor=new TrainModelProcessor();
  try {
    processor.run();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@Override public Void process() throws IOException {
  LOG.info("String_Node_Str");
  JSONUtils.writeValue(new File(pathFinder.getModelConfigPath(SourceType.LOCAL)),modelConfig);
  JSONUtils.writeValue(new File(pathFinder.getColumnConfigPath(SourceType.LOCAL)),columnConfigList);
  TrainModelProcessor processor=new TrainModelProcessor(super.otherConfigs);
  try {
    processor.run();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return null;
}
Program: 31993
Project: 31993
Buggy source:
@Override public Void process() throws IOException {
  LOG.info("String_Node_Str");
  JSONUtils.writeValue(new File(pathFinder.getModelConfigPath(SourceType.LOCAL)),modelConfig);
  JSONUtils.writeValue(new File(pathFinder.getColumnConfigPath(SourceType.LOCAL)),columnConfigList);
  VarSelectModelProcessor processor=new VarSelectModelProcessor();
  try {
    processor.run();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@Override public Void process() throws IOException {
  LOG.info("String_Node_Str");
  JSONUtils.writeValue(new File(pathFinder.getModelConfigPath(SourceType.LOCAL)),modelConfig);
  JSONUtils.writeValue(new File(pathFinder.getColumnConfigPath(SourceType.LOCAL)),columnConfigList);
  VarSelectModelProcessor processor=new VarSelectModelProcessor(super.otherConfigs);
  try {
    processor.run();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return null;
}
Program: 31994
Project: 31994
Buggy source:
@Test public void testUDFEnoughInput() throws Exception {
  Tuple tuple=TupleFactory.getInstance().newTuple(31);
  for (int i=0; i < 31; i++) {
    tuple.set(i,0);
  }
  tuple.set(0,"String_Node_Str");
  DataBag dataBag=instance.exec(tuple);
  Assert.assertEquals(30,dataBag.size());
  Assert.assertEquals(dataBag.iterator().next().size(),4);
}

Fixed version (ground truth):
@Test public void testUDFEnoughInput() throws Exception {
  Tuple tuple=TupleFactory.getInstance().newTuple(31);
  for (int i=0; i < 31; i++) {
    tuple.set(i,0);
  }
  tuple.set(0,"String_Node_Str");
  DataBag dataBag=instance.exec(tuple);
  Assert.assertEquals(30,dataBag.size());
  Assert.assertEquals(dataBag.iterator().next().size(),5);
}
Program: 32001
Project: 32001
Buggy source:
private void setHeapSizeAndSplitSize(final List<String> args){
  if (this.isDebug()) {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaMapReduceConstants.MAPRED_CHILD_JAVA_OPTS,"String_Node_Str"));
  }
 else {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaMapReduceConstants.MAPRED_CHILD_JAVA_OPTS,"String_Node_Str"));
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,"String_Node_Str","String_Node_Str" + "String_Node_Str"));
  }
  if (super.modelConfig.getNormalize().getIsParquet()) {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,Environment.getProperty(GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,"String_Node_Str")));
  }
 else {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,Environment.getProperty(GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,"String_Node_Str")));
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_SPLIT_MAX_COMBINED_SPLIT_SIZE,Environment.getProperty(GuaguaConstants.GUAGUA_SPLIT_MAX_COMBINED_SPLIT_SIZE,"String_Node_Str")));
  }
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_MIN_WORKERS_RATIO,0.98));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_MIN_WORKERS_TIMEOUT,2 * 1000L));
}

Fixed version (ground truth):
private void setHeapSizeAndSplitSize(final List<String> args){
  if (this.isDebug()) {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaMapReduceConstants.MAPRED_CHILD_JAVA_OPTS,"String_Node_Str"));
  }
 else {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaMapReduceConstants.MAPRED_CHILD_JAVA_OPTS,"String_Node_Str"));
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,"String_Node_Str","String_Node_Str" + "String_Node_Str"));
  }
  if (super.modelConfig.getNormalize().getIsParquet()) {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,Environment.getProperty(GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,"String_Node_Str")));
  }
 else {
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,Environment.getProperty(GuaguaConstants.GUAGUA_SPLIT_COMBINABLE,"String_Node_Str")));
    args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_SPLIT_MAX_COMBINED_SPLIT_SIZE,Environment.getProperty(GuaguaConstants.GUAGUA_SPLIT_MAX_COMBINED_SPLIT_SIZE,"String_Node_Str")));
  }
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_MIN_WORKERS_RATIO,0.97));
  args.add(String.format(CommonConstants.MAPREDUCE_PARAM_FORMAT,GuaguaConstants.GUAGUA_MIN_WORKERS_TIMEOUT,2 * 1000L));
}
Program: 32003
Project: 32003
Buggy source:
@Override public void postIteration(final MasterContext<DTMasterParams,DTWorkerParams> context){
  final int tmpModelFactor=DTrainUtils.tmpModelFactor(context.getTotalIteration());
  if (context.getCurrentIteration() % tmpModelFactor == 0) {
    Thread tmpModelPersistThread=new Thread(new Runnable(){
      @Override public void run(){
        saveTmpModelToHDFS(context.getCurrentIteration(),context.getMasterResult().getTrees());
        Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
        writeModelToFileSystem(context.getMasterResult().getTrees(),out);
      }
    }
,"String_Node_Str");
    tmpModelPersistThread.setDaemon(true);
    tmpModelPersistThread.start();
  }
  updateProgressLog(context);
}

Fixed version (ground truth):
@Override public void postIteration(final MasterContext<DTMasterParams,DTWorkerParams> context){
  final int tmpModelFactor=DTrainUtils.tmpModelFactor(context.getTotalIteration());
  if (isRF) {
    if (context.getCurrentIteration() % (tmpModelFactor * 2) == 0) {
      Thread tmpModelPersistThread=new Thread(new Runnable(){
        @Override public void run(){
          saveTmpModelToHDFS(context.getCurrentIteration(),context.getMasterResult().getTrees());
          Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
          writeModelToFileSystem(context.getMasterResult().getTrees(),out);
        }
      }
,"String_Node_Str");
      tmpModelPersistThread.setDaemon(true);
      tmpModelPersistThread.start();
    }
  }
 else   if (isGBDT) {
    if (context.getMasterResult().isSwitchToNextTree() && context.getMasterResult().getTrees().size() % 25 == 0) {
      final List<TreeNode> trees=context.getMasterResult().getTrees();
      if (trees.size() > 1) {
        Thread tmpModelPersistThread=new Thread(new Runnable(){
          @Override public void run(){
            List<TreeNode> subTrees=trees.subList(0,trees.size() - 1);
            saveTmpModelToHDFS(context.getCurrentIteration(),subTrees);
            Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
            writeModelToFileSystem(subTrees,out);
          }
        }
,"String_Node_Str");
        tmpModelPersistThread.setDaemon(true);
        tmpModelPersistThread.start();
      }
    }
  }
  updateProgressLog(context);
}
Program: 32004
Project: 32004
Buggy source:
@Override public void run(){
  saveTmpModelToHDFS(context.getCurrentIteration(),context.getMasterResult().getTrees());
  Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
  writeModelToFileSystem(context.getMasterResult().getTrees(),out);
}

Fixed version (ground truth):
@Override public void run(){
  List<TreeNode> subTrees=trees.subList(0,trees.size() - 1);
  saveTmpModelToHDFS(context.getCurrentIteration(),subTrees);
  Path out=new Path(context.getProps().getProperty(CommonConstants.GUAGUA_OUTPUT));
  writeModelToFileSystem(subTrees,out);
}
Program: 32007
Project: 32007
Buggy source:
private InternalEntropyInfo getGiniInfo(double[] statsByClasses){
  double sumAll=0;
  for (int i=0; i < statsByClasses.length; i++) {
    sumAll+=statsByClasses[i];
  }
  double impurity=0d;
  int indexOfLargestElement=-1;
  if (sumAll != 0d) {
    double maxElement=Double.MIN_VALUE;
    for (int i=0; i < statsByClasses.length; i++) {
      double rate=statsByClasses[i] / sumAll;
      impurity-=rate * rate;
      if (statsByClasses[i] > maxElement) {
        maxElement=statsByClasses[i];
        indexOfLargestElement=i;
      }
    }
  }
  return new InternalEntropyInfo(sumAll,indexOfLargestElement,impurity);
}

Fixed version (ground truth):
private InternalGiniInfo getGiniInfo(double[] statsByClasses){
  double sumAll=0;
  for (int i=0; i < statsByClasses.length; i++) {
    sumAll+=statsByClasses[i];
  }
  double impurity=0d;
  int indexOfLargestElement=-1;
  if (sumAll != 0d) {
    double maxElement=Double.MIN_VALUE;
    for (int i=0; i < statsByClasses.length; i++) {
      double rate=statsByClasses[i] / sumAll;
      impurity-=rate * rate;
      if (statsByClasses[i] > maxElement) {
        maxElement=statsByClasses[i];
        indexOfLargestElement=i;
      }
    }
  }
  return new InternalGiniInfo(sumAll,indexOfLargestElement,impurity);
}
Program: 32009
Project: 32009
Buggy source:
public Pair(int index,double value){
  super();
  this.index=index;
  this.value=value;
}

Fixed version (ground truth):
public Pair(int index,double value){
  this.index=index;
  this.value=value;
}
Program: 32012
Project: 32012
Buggy source:
@Override public void doReadFields(DataInput in) throws IOException {
  this.trainCount=in.readLong();
  this.validationCount=in.readLong();
  this.trainError=in.readDouble();
  this.validationError=in.readDouble();
  this.isSwitchToNextTree=in.readBoolean();
  int treeNum=in.readInt();
  this.trees=new ArrayList<TreeNode>(treeNum);
  for (int i=0; i < treeNum; i++) {
    TreeNode treeNode=new TreeNode();
    treeNode.readFieldsWithoutFeatures(in);
    this.trees.add(treeNode);
  }
  int todoNodesSize=in.readInt();
  if (todoNodesSize > 0) {
    todoNodes=new HashMap<Integer,TreeNode>(todoNodesSize,1f);
    for (int i=0; i < todoNodesSize; i++) {
      int key=in.readInt();
      TreeNode treeNode=new TreeNode();
      treeNode.readFields(in);
      todoNodes.put(key,treeNode);
    }
  }
  this.isContinuousRunningStart=in.readBoolean();
}

Fixed version (ground truth):
@Override public void doReadFields(DataInput in) throws IOException {
  this.trainCount=in.readDouble();
  this.validationCount=in.readDouble();
  this.trainError=in.readDouble();
  this.validationError=in.readDouble();
  this.isSwitchToNextTree=in.readBoolean();
  int treeNum=in.readInt();
  this.trees=new ArrayList<TreeNode>(treeNum);
  for (int i=0; i < treeNum; i++) {
    TreeNode treeNode=new TreeNode();
    treeNode.readFieldsWithoutFeatures(in);
    this.trees.add(treeNode);
  }
  int todoNodesSize=in.readInt();
  if (todoNodesSize > 0) {
    todoNodes=new HashMap<Integer,TreeNode>(todoNodesSize,1f);
    for (int i=0; i < todoNodesSize; i++) {
      int key=in.readInt();
      TreeNode treeNode=new TreeNode();
      treeNode.readFields(in);
      todoNodes.put(key,treeNode);
    }
  }
  this.isContinuousRunningStart=in.readBoolean();
}
Program: 32013
Project: 32013
Buggy source:
/** 
 * @return the trainCount
 */
public long getTrainCount(){
  return trainCount;
}

Fixed version (ground truth):
/** 
 * @return the trainCount
 */
public double getTrainCount(){
  return trainCount;
}
Program: 32014
Project: 32014
Buggy source:
/** 
 * @return the validationCount
 */
public long getValidationCount(){
  return validationCount;
}

Fixed version (ground truth):
/** 
 * @return the validationCount
 */
public double getValidationCount(){
  return validationCount;
}
Program: 32015
Project: 32015
Buggy source:
/** 
 * @param validationCount the validationCount to set
 */
public void setValidationCount(long validationCount){
  this.validationCount=validationCount;
}

Fixed version (ground truth):
/** 
 * @param validationCount the validationCount to set
 */
public void setValidationCount(double validationCount){
  this.validationCount=validationCount;
}
Program: 32016
Project: 32016
Buggy source:
/** 
 * @param trainCount the trainCount to set
 */
public void setTrainCount(long trainCount){
  this.trainCount=trainCount;
}

Fixed version (ground truth):
/** 
 * @param trainCount the trainCount to set
 */
public void setTrainCount(double trainCount){
  this.trainCount=trainCount;
}
Program: 32019
Project: 32019
Buggy source:
@Override public void doReadFields(DataInput in) throws IOException {
  this.trainCount=in.readLong();
  this.validationCount=in.readLong();
  this.trainError=in.readDouble();
  this.validationError=in.readDouble();
  if (in.readBoolean()) {
    this.nodeStatsMap=new HashMap<Integer,NodeStats>();
    int len=in.readInt();
    for (int i=0; i < len; i++) {
      int key=in.readInt();
      NodeStats stats=new NodeStats();
      stats.readFields(in);
      this.nodeStatsMap.put(key,stats);
    }
  }
}

Fixed version (ground truth):
@Override public void doReadFields(DataInput in) throws IOException {
  this.trainCount=in.readDouble();
  this.validationCount=in.readDouble();
  this.trainError=in.readDouble();
  this.validationError=in.readDouble();
  if (in.readBoolean()) {
    this.nodeStatsMap=new HashMap<Integer,NodeStats>();
    int len=in.readInt();
    for (int i=0; i < len; i++) {
      int key=in.readInt();
      NodeStats stats=new NodeStats();
      stats.readFields(in);
      this.nodeStatsMap.put(key,stats);
    }
  }
}
Program: 32020
Project: 32020
Buggy source:
/** 
 * @return the trainCount
 */
public long getTrainCount(){
  return trainCount;
}

Fixed version (ground truth):
/** 
 * @return the trainCount
 */
public double getTrainCount(){
  return trainCount;
}
Program: 32021
Project: 32021
Buggy source:
/** 
 * @return the validationCount
 */
public long getValidationCount(){
  return validationCount;
}

Fixed version (ground truth):
/** 
 * @return the validationCount
 */
public double getValidationCount(){
  return validationCount;
}
Program: 32022
Project: 32022
Buggy source:
/** 
 * @param validationCount the validationCount to set
 */
public void setValidationCount(long validationCount){
  this.validationCount=validationCount;
}

Fixed version (ground truth):
/** 
 * @param validationCount the validationCount to set
 */
public void setValidationCount(double validationCount){
  this.validationCount=validationCount;
}
Program: 32023
Project: 32023
Buggy source:
@Override public void doWrite(DataOutput out) throws IOException {
  out.writeLong(trainCount);
  out.writeLong(validationCount);
  out.writeDouble(trainError);
  out.writeDouble(validationError);
  if (nodeStatsMap == null) {
    out.writeBoolean(false);
  }
 else {
    out.writeBoolean(true);
    out.writeInt(nodeStatsMap.size());
    for (    Entry<Integer,NodeStats> entry : nodeStatsMap.entrySet()) {
      out.writeInt(entry.getKey());
      entry.getValue().write(out);
    }
  }
}

Fixed version (ground truth):
@Override public void doWrite(DataOutput out) throws IOException {
  out.writeDouble(trainCount);
  out.writeDouble(validationCount);
  out.writeDouble(trainError);
  out.writeDouble(validationError);
  if (nodeStatsMap == null) {
    out.writeBoolean(false);
  }
 else {
    out.writeBoolean(true);
    out.writeInt(nodeStatsMap.size());
    for (    Entry<Integer,NodeStats> entry : nodeStatsMap.entrySet()) {
      out.writeInt(entry.getKey());
      entry.getValue().write(out);
    }
  }
}
Program: 32024
Project: 32024
Buggy source:
/** 
 * @param trainCount the trainCount to set
 */
public void setTrainCount(long trainCount){
  this.trainCount=trainCount;
}

Fixed version (ground truth):
/** 
 * @param trainCount the trainCount to set
 */
public void setTrainCount(double trainCount){
  this.trainCount=trainCount;
}
Program: 32025
Project: 32025
Buggy source:
public DTWorkerParams(long trainCount,long validationCount,double trainError,double validationError,Map<Integer,NodeStats> nodeStatsMap){
  this.trainCount=trainCount;
  this.validationCount=validationCount;
  this.trainError=trainError;
  this.validationError=validationError;
  this.nodeStatsMap=nodeStatsMap;
}

Fixed version (ground truth):
public DTWorkerParams(double trainCount,double validationCount,double trainError,double validationError,Map<Integer,NodeStats> nodeStatsMap){
  this.trainCount=trainCount;
  this.validationCount=validationCount;
  this.trainError=trainError;
  this.validationError=validationError;
  this.nodeStatsMap=nodeStatsMap;
}
Program: 32027
Project: 32027
Buggy source:
private float updateOneVsAllTargetValue(float ideal){
  float result=0f;
  if (Float.compare(ideal,trainerId) == 0) {
    result=1.0f;
  }
 else {
    result=0.0f;
  }
  return result;
}

Fixed version (ground truth):
private float updateOneVsAllTargetValue(float ideal){
  return Float.compare(ideal,trainerId) == 0 ? 1f : 0f;
}
Program: 32028
Project: 32028
Buggy source:
/** 
 * 'binBoundary' is ArrayList in fact, so we can use get method. ["-Infinity", 1d, 4d, ....]
 */
private int getBinIndex(float value,List<Double> binBoundary){
  if (binBoundary.size() <= 1) {
    throw new IllegalArgumentException();
  }
  int low=0, high=binBoundary.size() - 1;
  while (low <= high) {
    int mid=(low + high) >>> 1;
    double lowThreshold=binBoundary.get(mid);
    double highThreshold=mid == binBoundary.size() - 1 ? Double.MAX_VALUE : binBoundary.get(mid + 1);
    if (value >= lowThreshold && value < highThreshold) {
      return mid;
    }
    if (value >= highThreshold) {
      low=mid + 1;
    }
 else {
      high=mid - 1;
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * 'binBoundary' is ArrayList in fact, so we can use get method. ["-Infinity", 1d, 4d, ....]
 */
public static int getBinIndex(float value,List<Double> binBoundary){
  if (binBoundary.size() <= 1) {
    throw new IllegalArgumentException();
  }
  int low=0, high=binBoundary.size() - 1;
  while (low <= high) {
    int mid=(low + high) >>> 1;
    double lowThreshold=binBoundary.get(mid);
    double highThreshold=mid == binBoundary.size() - 1 ? Double.MAX_VALUE : binBoundary.get(mid + 1);
    if (value >= lowThreshold && value < highThreshold) {
      return mid;
    }
    if (value >= highThreshold) {
      low=mid + 1;
    }
 else {
      high=mid - 1;
    }
  }
  return -1;
}
Program: 32033
Project: 32033
Buggy source:
@SuppressWarnings("String_Node_Str") private void incrementTagCounters(String tag,String weight){
  long weightLong=(long)(Double.parseDouble(weight) * Constants.EVAL_COUNTER_WEIGHT_SCALE);
  if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_RECORDS)) {
    PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_RECORDS).increment(1);
  }
  if (posTagSet.contains(tag)) {
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_POSTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_POSTAGS).increment(1);
    }
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WPOSTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WPOSTAGS).increment(weightLong);
    }
  }
  if (negTagSet.contains(tag)) {
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_NEGTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_NEGTAGS).increment(1);
    }
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WNEGTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WNEGTAGS).increment(weightLong);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void incrementTagCounters(String tag,String weight){
  if (tag == null || weight == null) {
    log.warn("String_Node_Str" + tag + "String_Node_Str"+ weight);
    return;
  }
  double dWeight=1;
  if (weight.length() != 0) {
    dWeight=NumberFormatUtils.getDouble(weight,1);
  }
  long weightLong=(long)(dWeight * Constants.EVAL_COUNTER_WEIGHT_SCALE);
  if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_RECORDS)) {
    PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_RECORDS).increment(1);
  }
  if (posTagSet.contains(tag)) {
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_POSTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_POSTAGS).increment(1);
    }
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WPOSTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WPOSTAGS).increment(weightLong);
    }
  }
  if (negTagSet.contains(tag)) {
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_NEGTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_NEGTAGS).increment(1);
    }
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WNEGTAGS)) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,Constants.COUNTER_WNEGTAGS).increment(weightLong);
    }
  }
}
Program: 32035
Project: 32035
Buggy source:
@Override public final MLData compute(final MLData input){
  double[] data=input.getData();
  double predictSum=0d;
  double weightSum=0d;
  for (int i=0; i < this.trees.size(); i++) {
    TreeNode treeNode=this.trees.get(i);
    Double weight=this.weights.get(i);
    weightSum+=weight;
    predictSum+=predictNode(treeNode.getNode(),data) * weight;
  }
  double finalPredict=predictSum / weightSum;
  MLData result=new BasicMLData(1);
  result.setData(0,finalPredict);
  return result;
}

Fixed version (ground truth):
@Override public final MLData compute(final MLData input){
  double[] data=input.getData();
  double predictSum=0d;
  double weightSum=0d;
  for (int i=0; i < this.trees.size(); i++) {
    TreeNode treeNode=this.trees.get(i);
    Double weight=this.weights.get(i);
    weightSum+=weight;
    predictSum+=predictNode(treeNode.getNode(),data) * weight;
  }
  double finalPredict;
  if (this.isGBDT) {
    finalPredict=predictSum;
  }
 else {
    finalPredict=predictSum / weightSum;
  }
  MLData result=new BasicMLData(1);
  result.setData(0,finalPredict);
  return result;
}
Program: 32039
Project: 32039
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){
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  DerivedField derivedField=super.createNumericalDerivedField(config,cutoff).get(0);
  derivedFields.add(derivedField);
  double[] meanAndStdDev=Normalizer.calculateWoeMeanAndStdDev(config,isWeightedNorm);
  LinearNorm from=new LinearNorm().withOrig(meanAndStdDev[0] - meanAndStdDev[1] * cutoff).withNorm(-cutoff);
  LinearNorm to=new LinearNorm().withOrig(meanAndStdDev[0] + meanAndStdDev[1] * cutoff).withNorm(cutoff);
  NormContinuous normContinuous=new NormContinuous(FieldName.create(derivedField.getName().getValue())).withLinearNorms(from,to).withMapMissingTo(0.0).withOutliers(OutlierTreatmentMethodType.AS_EXTREME_VALUES);
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(config.getColumnName()))).withExpression(normContinuous));
  return derivedFields;
}

Fixed version (ground truth):
/** 
 * Create @DerivedField for numerical variable
 * @param config - ColumnConfig for numerical variable
 * @param cutoff - cutoff of normalization
 * @return DerivedField for variable
 */
@Override protected List<DerivedField> createNumericalDerivedField(ColumnConfig config,double cutoff,ModelNormalizeConf.NormType normType){
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  DerivedField derivedField=super.createNumericalDerivedField(config,cutoff,ModelNormalizeConf.NormType.WOE).get(0);
  derivedFields.add(derivedField);
  double[] meanAndStdDev=Normalizer.calculateWoeMeanAndStdDev(config,isWeightedNorm);
  LinearNorm from=new LinearNorm().withOrig(meanAndStdDev[0] - meanAndStdDev[1] * cutoff).withNorm(-cutoff);
  LinearNorm to=new LinearNorm().withOrig(meanAndStdDev[0] + meanAndStdDev[1] * cutoff).withNorm(cutoff);
  NormContinuous normContinuous=new NormContinuous(FieldName.create(derivedField.getName().getValue())).withLinearNorms(from,to).withMapMissingTo(0.0).withOutliers(OutlierTreatmentMethodType.AS_EXTREME_VALUES);
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(config.getColumnName(),normType))).withExpression(normContinuous));
  return derivedFields;
}
Program: 32041
Project: 32041
Buggy source:
@Override public LocalTransformations build(){
  LocalTransformations localTransformations=new LocalTransformations();
  for (  ColumnConfig config : columnConfigList) {
    if (config.isFinalSelect()) {
      double cutoff=modelConfig.getNormalizeStdDevCutOff();
      localTransformations.withDerivedFields(config.isCategorical() ? createCategoricalDerivedField(config,cutoff) : createNumericalDerivedField(config,cutoff));
    }
  }
  return localTransformations;
}

Fixed version (ground truth):
@Override public LocalTransformations build(){
  LocalTransformations localTransformations=new LocalTransformations();
  for (  ColumnConfig config : columnConfigList) {
    if (config.isFinalSelect()) {
      double cutoff=modelConfig.getNormalizeStdDevCutOff();
      localTransformations.withDerivedFields(config.isCategorical() ? createCategoricalDerivedField(config,cutoff,modelConfig.getNormalizeType()) : createNumericalDerivedField(config,cutoff,modelConfig.getNormalizeType()));
    }
  }
  return localTransformations;
}
Program: 32042
Project: 32042
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){
  LinearNorm from=new LinearNorm().withOrig(config.getMean() - config.getStdDev() * cutoff).withNorm(-cutoff);
  LinearNorm to=new LinearNorm().withOrig(config.getMean() + config.getStdDev() * cutoff).withNorm(cutoff);
  NormContinuous normContinuous=new NormContinuous(FieldName.create(config.getColumnName())).withLinearNorms(from,to).withMapMissingTo(0.0).withOutliers(OutlierTreatmentMethodType.AS_EXTREME_VALUES);
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(config.getColumnName()))).withExpression(normContinuous));
  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
 */
protected List<DerivedField> createNumericalDerivedField(ColumnConfig config,double cutoff,ModelNormalizeConf.NormType normType){
  LinearNorm from=new LinearNorm().withOrig(config.getMean() - config.getStdDev() * cutoff).withNorm(-cutoff);
  LinearNorm to=new LinearNorm().withOrig(config.getMean() + config.getStdDev() * cutoff).withNorm(cutoff);
  NormContinuous normContinuous=new NormContinuous(FieldName.create(config.getColumnName())).withLinearNorms(from,to).withMapMissingTo(0.0).withOutliers(OutlierTreatmentMethodType.AS_EXTREME_VALUES);
  List<DerivedField> derivedFields=new ArrayList<DerivedField>();
  derivedFields.add(new DerivedField(OpType.CONTINUOUS,DataType.DOUBLE).withName(FieldName.create(genPmmlColumnName(config.getColumnName(),normType))).withExpression(normContinuous));
  return derivedFields;
}
Program: 32043
Project: 32043
Buggy source:
/** 
 * Convert column name into PMML format(with normalization)
 * @param columnName
 * @return - PMML standard column name
 */
protected String genPmmlColumnName(String columnName){
  return columnName + "String_Node_Str" + this.modelConfig.getNormalizeType().name().toLowerCase();
}

Fixed version (ground truth):
/** 
 * Convert column name into PMML format(with normalization)
 * @param columnName
 * @parm normType
 * @return - PMML standard column name
 */
protected String genPmmlColumnName(String columnName,ModelNormalizeConf.NormType normType){
  return columnName + "String_Node_Str" + normType.name().toLowerCase();
}
Program: 32045
Project: 32045
Buggy source:
@Override public int run() throws Exception {
  int status=0;
  File pmmls=new File("String_Node_Str");
  FileUtils.forceMkdir(pmmls);
  if (StringUtils.isBlank(type)) {
    type=PMML;
  }
  if (type.equalsIgnoreCase(PMML)) {
    log.info("String_Node_Str",type);
    ModelConfig modelConfig=CommonUtils.loadModelConfig();
    List<ColumnConfig> columnConfigList=CommonUtils.loadColumnConfigList();
    PathFinder pathFinder=new PathFinder(modelConfig);
    List<BasicML> models=CommonUtils.loadBasicModels(pathFinder.getModelsPath(SourceType.LOCAL),ALGORITHM.valueOf(modelConfig.getAlgorithm().toUpperCase()));
    PMMLTranslator translator=PMMLConstructorFactory.produce(modelConfig,columnConfigList,this.isConcise);
    for (int index=0; index < models.size(); index++) {
      log.info("String_Node_Str" + "String_Node_Str" + File.separator + modelConfig.getModelSetName()+ Integer.toString(index)+ "String_Node_Str");
      PMML pmml=translator.build(models.get(index));
      PMMLUtils.savePMML(pmml,"String_Node_Str" + File.separator + modelConfig.getModelSetName()+ Integer.toString(index)+ "String_Node_Str");
    }
  }
 else   if (type.equalsIgnoreCase(COLUMN_STATS)) {
    saveColumnStatus();
  }
 else {
    log.error("String_Node_Str",type);
    status=-1;
  }
  log.info("String_Node_Str");
  return status;
}

Fixed version (ground truth):
@Override public int run() throws Exception {
  setUp(ModelStep.EXPORT);
  int status=0;
  File pmmls=new File("String_Node_Str");
  FileUtils.forceMkdir(pmmls);
  if (StringUtils.isBlank(type)) {
    type=PMML;
  }
  if (type.equalsIgnoreCase(PMML)) {
    log.info("String_Node_Str",type);
    ModelConfig modelConfig=CommonUtils.loadModelConfig();
    List<ColumnConfig> columnConfigList=CommonUtils.loadColumnConfigList();
    PathFinder pathFinder=new PathFinder(modelConfig);
    List<BasicML> models=CommonUtils.loadBasicModels(pathFinder.getModelsPath(SourceType.LOCAL),ALGORITHM.valueOf(modelConfig.getAlgorithm().toUpperCase()));
    PMMLTranslator translator=PMMLConstructorFactory.produce(modelConfig,columnConfigList,this.isConcise);
    for (int index=0; index < models.size(); index++) {
      log.info("String_Node_Str" + "String_Node_Str" + File.separator + modelConfig.getModelSetName()+ Integer.toString(index)+ "String_Node_Str");
      PMML pmml=translator.build(models.get(index));
      PMMLUtils.savePMML(pmml,"String_Node_Str" + File.separator + modelConfig.getModelSetName()+ Integer.toString(index)+ "String_Node_Str");
    }
  }
 else   if (type.equalsIgnoreCase(COLUMN_STATS)) {
    saveColumnStatus();
  }
 else {
    log.error("String_Node_Str",type);
    status=-1;
  }
  clearUp(ModelStep.EXPORT);
  log.info("String_Node_Str");
  return status;
}