Program: 31602
Project: 31602
Buggy source:
@Override public Tuple exec(Tuple input) throws IOException {
  if (input == null || input.size() != 1) {
    return null;
  }
  Integer columnId=null;
  ColumnConfig columnConfig=null;
  String binsData=null;
  Set<String> missingValSet=new HashSet<String>(super.modelConfig.getMissingOrInvalidValues());
  List<NumBinInfo> binInfoList=null;
  DataBag columnDataBag=(DataBag)input.get(0);
  Iterator<Tuple> iterator=columnDataBag.iterator();
  while (iterator.hasNext()) {
    Tuple tuple=iterator.next();
    if (columnId == null) {
      columnId=(Integer)tuple.get(0);
      if (columnId >= super.columnConfigList.size()) {
        int newColumnId=columnId % super.columnConfigList.size();
        columnConfig=super.columnConfigList.get(newColumnId);
      }
 else {
        columnConfig=super.columnConfigList.get(columnId);
      }
      String smallBins=smallBinsMap.get(columnId);
      if (columnConfig.isCategorical()) {
        binsData=smallBins;
        break;
      }
 else {
        binInfoList=NumBinInfo.constructNumBinfo(smallBins,AbstractBinning.FIELD_SEPARATOR);
      }
    }
    String val=(String)tuple.get(1);
    Boolean isPositiveInst=(Boolean)tuple.get(2);
    if (missingValSet.contains(val)) {
      continue;
    }
    Double d=null;
    try {
      d=Double.valueOf(val);
    }
 catch (    Exception e) {
      continue;
    }
    NumBinInfo numBinInfo=binaryLocate(binInfoList,d);
    if (numBinInfo != null) {
      numBinInfo.incInstCnt(isPositiveInst);
    }
  }
  if (binsData == null && CollectionUtils.isNotEmpty(binInfoList)) {
    int maxNumBin=modelConfig.getStats().getMaxNumBin();
    if (maxNumBin <= 0) {
      maxNumBin=1024;
    }
    DynamicBinning dynamicBinning=new DynamicBinning(binInfoList,maxNumBin);
    List<Double> binFields=dynamicBinning.getDataBin();
    binsData=StringUtils.join(binFields,CalculateStatsUDF.CATEGORY_VAL_SEPARATOR);
  }
  Tuple output=TupleFactory.getInstance().newTuple(2);
  output.set(0,columnId);
  output.set(1,binsData);
  return output;
}

Fixed version (ground truth):
@Override public Tuple exec(Tuple input) throws IOException {
  if (smallBinsMap == null) {
    smallBinsMap=new HashMap<Integer,String>();
    List<String> smallBinsList=ShifuFileUtils.readFilePartsIntoList(smallBinsPath,SourceType.HDFS);
    for (    String smallBin : smallBinsList) {
      String[] fields=StringUtils.split(smallBin,'\u0007');
      if (fields.length == 2) {
        smallBinsMap.put(Integer.parseInt(fields[0]),fields[1]);
      }
    }
  }
  if (input == null || input.size() != 1) {
    return null;
  }
  Integer columnId=null;
  ColumnConfig columnConfig=null;
  String binsData=null;
  Set<String> missingValSet=new HashSet<String>(super.modelConfig.getMissingOrInvalidValues());
  List<NumBinInfo> binInfoList=null;
  DataBag columnDataBag=(DataBag)input.get(0);
  Iterator<Tuple> iterator=columnDataBag.iterator();
  while (iterator.hasNext()) {
    Tuple tuple=iterator.next();
    if (columnId == null) {
      columnId=(Integer)tuple.get(0);
      if (columnId >= super.columnConfigList.size()) {
        int newColumnId=columnId % super.columnConfigList.size();
        columnConfig=super.columnConfigList.get(newColumnId);
      }
 else {
        columnConfig=super.columnConfigList.get(columnId);
      }
      String smallBins=smallBinsMap.get(columnId);
      if (columnConfig.isCategorical()) {
        binsData=smallBins;
        break;
      }
 else {
        binInfoList=NumBinInfo.constructNumBinfo(smallBins,AbstractBinning.FIELD_SEPARATOR);
      }
    }
    String val=(String)tuple.get(1);
    Boolean isPositiveInst=(Boolean)tuple.get(2);
    if (missingValSet.contains(val)) {
      continue;
    }
    Double d=null;
    try {
      d=Double.valueOf(val);
    }
 catch (    Exception e) {
      continue;
    }
    NumBinInfo numBinInfo=binaryLocate(binInfoList,d);
    if (numBinInfo != null) {
      numBinInfo.incInstCnt(isPositiveInst);
    }
  }
  if (binsData == null && CollectionUtils.isNotEmpty(binInfoList)) {
    int maxNumBin=modelConfig.getStats().getMaxNumBin();
    if (maxNumBin <= 0) {
      maxNumBin=1024;
    }
    DynamicBinning dynamicBinning=new DynamicBinning(binInfoList,maxNumBin);
    List<Double> binFields=dynamicBinning.getDataBin();
    binsData=StringUtils.join(binFields,CalculateStatsUDF.CATEGORY_VAL_SEPARATOR);
  }
  Tuple output=TupleFactory.getInstance().newTuple(2);
  output.set(0,columnId);
  output.set(1,binsData);
  return output;
}