Program: 31654
Project: 31654
Buggy source:
/** 
 * Mapper implementation includes: 1. Invalid data purifier 2. Column statistics update.
 */
@Override protected void map(LongWritable key,Text value,Context context) throws IOException, InterruptedException {
  String valueStr=value.toString();
  if (valueStr == null || valueStr.length() == 0 || valueStr.trim().length() == 0) {
    LOG.warn("String_Node_Str");
    return;
  }
  context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
  if (!this.dataPurifier.isFilter(valueStr)) {
    context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
    return;
  }
  String[] units=CommonUtils.split(valueStr,this.dataSetDelimiter);
  String tag=CommonUtils.trimTag(units[this.tagColumnNum]);
  if (modelConfig.isRegression()) {
    if (tag == null || (!posTags.contains(tag) && !negTags.contains(tag))) {
      context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
      return;
    }
  }
 else {
    if (tag == null || (!tags.contains(tag))) {
      context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
      return;
    }
  }
  Double weight=1.0;
  try {
    weight=(this.weightedColumnNum == -1 ? 1.0d : Double.valueOf(units[this.weightedColumnNum]));
    if (weight < 0) {
      weightExceptions+=1;
      context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
      if (weightExceptions > 5000 && this.isThrowforWeightException) {
        throw new IllegalStateException("String_Node_Str");
      }
    }
  }
 catch (  NumberFormatException e) {
    weightExceptions+=1;
    context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
    if (weightExceptions > 5000 && this.isThrowforWeightException) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  for (int i=0; i < units.length; i++) {
    populateStats(units,tag,weight,i,i);
    if (this.isForExpressions) {
      for (int j=0; j < this.expressionDataPurifiers.size(); j++) {
        DataPurifier dp=this.expressionDataPurifiers.get(j);
        if (dp.isFilter(valueStr)) {
          populateStats(units,tag,weight,i,(j + 1) * units.length + i);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Mapper implementation includes: 1. Invalid data purifier 2. Column statistics update.
 */
@Override protected void map(LongWritable key,Text value,Context context) throws IOException, InterruptedException {
  String valueStr=value.toString();
  if (valueStr == null || valueStr.length() == 0 || valueStr.trim().length() == 0) {
    LOG.warn("String_Node_Str");
    return;
  }
  context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
  if (!this.dataPurifier.isFilter(valueStr)) {
    context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
    return;
  }
  String[] units=CommonUtils.split(valueStr,this.dataSetDelimiter);
  String tag=CommonUtils.trimTag(units[this.tagColumnNum]);
  if (modelConfig.isRegression()) {
    if (tag == null || (!posTags.contains(tag) && !negTags.contains(tag))) {
      context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
      return;
    }
  }
 else {
    if (tag == null || (!tags.contains(tag))) {
      context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
      return;
    }
  }
  Double weight=1.0;
  try {
    weight=(this.weightedColumnNum == -1 ? 1.0d : Double.valueOf(units[this.weightedColumnNum]));
    if (weight < 0) {
      weightExceptions+=1;
      context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
      if (weightExceptions > 5000 && this.isThrowforWeightException) {
        throw new IllegalStateException("String_Node_Str");
      }
    }
  }
 catch (  NumberFormatException e) {
    weightExceptions+=1;
    context.getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1L);
    if (weightExceptions > 5000 && this.isThrowforWeightException) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  List<Boolean> filterResults=null;
  if (this.isForExpressions) {
    filterResults=new ArrayList<Boolean>();
    for (int j=0; j < this.expressionDataPurifiers.size(); j++) {
      DataPurifier dp=this.expressionDataPurifiers.get(j);
      filterResults.add(dp.isFilter(valueStr));
    }
  }
  for (int i=0; i < units.length; i++) {
    populateStats(units,tag,weight,i,i);
    if (this.isForExpressions) {
      for (int j=0; j < this.expressionDataPurifiers.size(); j++) {
        Boolean filter=filterResults.get(j);
        if (filter != null && filter) {
          populateStats(units,tag,weight,i,(j + 1) * units.length + i);
        }
      }
    }
  }
}