Program: 31653
Project: 31653
Buggy source:
private void populateStats(String[] units,String tag,Double weight,int columnIndex,int newCCIndex){
  ColumnConfig columnConfig=this.columnConfigList.get(columnIndex);
  CountAndFrequentItems countAndFrequentItems=this.variableCountMap.get(newCCIndex);
  if (countAndFrequentItems == null) {
    countAndFrequentItems=new CountAndFrequentItems();
    this.variableCountMap.put(newCCIndex,countAndFrequentItems);
  }
  countAndFrequentItems.offer(this.missingOrInvalidValues,units[columnIndex]);
  boolean isMissingValue=false;
  boolean isInvalidValue=false;
  BinningInfoWritable binningInfoWritable=this.columnBinningInfo.get(newCCIndex);
  if (binningInfoWritable == null) {
    return;
  }
  binningInfoWritable.setTotalCount(binningInfoWritable.getTotalCount() + 1L);
  if (columnConfig.isHybrid()) {
    int binNum=0;
    if (units[columnIndex] == null || missingOrInvalidValues.contains(units[columnIndex].toLowerCase())) {
      isMissingValue=true;
    }
    String str=StringUtils.trim(units[columnIndex]);
    double douVal=CommonUtils.parseNumber(str);
    Double hybridThreshould=columnConfig.getHybridThreshold();
    if (hybridThreshould == null) {
      hybridThreshould=Double.NEGATIVE_INFINITY;
    }
    boolean isCategory=Double.isNaN(douVal) || douVal < hybridThreshould;
    boolean isNumber=!Double.isNaN(douVal);
    if (isMissingValue) {
      binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
      binNum=binningInfoWritable.getBinCategories().size() + binningInfoWritable.getBinBoundaries().size();
    }
 else     if (isCategory) {
      binNum=quickLocateCategoricalBin(this.categoricalBinMap.get(newCCIndex),str);
      if (binNum < 0) {
        isInvalidValue=true;
      }
      if (isInvalidValue) {
        binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
        binNum=binningInfoWritable.getBinCategories().size() + binningInfoWritable.getBinBoundaries().size();
      }
 else {
        binNum+=binningInfoWritable.getBinBoundaries().size();
        ;
      }
    }
 else     if (isNumber) {
      binNum=getBinNum(binningInfoWritable.getBinBoundaries(),douVal);
      if (binNum == -1) {
        throw new RuntimeException("String_Node_Str");
      }
      binningInfoWritable.setSum(binningInfoWritable.getSum() + douVal);
      double squaredVal=douVal * douVal;
      binningInfoWritable.setSquaredSum(binningInfoWritable.getSquaredSum() + squaredVal);
      binningInfoWritable.setTripleSum(binningInfoWritable.getTripleSum() + squaredVal * douVal);
      binningInfoWritable.setQuarticSum(binningInfoWritable.getQuarticSum() + squaredVal * squaredVal);
      if (Double.compare(binningInfoWritable.getMax(),douVal) < 0) {
        binningInfoWritable.setMax(douVal);
      }
      if (Double.compare(binningInfoWritable.getMin(),douVal) > 0) {
        binningInfoWritable.setMin(douVal);
      }
    }
    if (posTags.contains(tag)) {
      binningInfoWritable.getBinCountPos()[binNum]+=1L;
      binningInfoWritable.getBinWeightPos()[binNum]+=weight;
    }
 else     if (negTags.contains(tag)) {
      binningInfoWritable.getBinCountNeg()[binNum]+=1L;
      binningInfoWritable.getBinWeightNeg()[binNum]+=weight;
    }
  }
 else   if (columnConfig.isCategorical()) {
    int lastBinIndex=binningInfoWritable.getBinCategories().size();
    int binNum=0;
    if (units[columnIndex] == null || missingOrInvalidValues.contains(units[columnIndex].toLowerCase())) {
      isMissingValue=true;
    }
 else {
      String str=StringUtils.trim(units[columnIndex]);
      binNum=quickLocateCategoricalBin(this.categoricalBinMap.get(columnIndex),str);
      if (binNum < 0) {
        isInvalidValue=true;
      }
    }
    if (isInvalidValue || isMissingValue) {
      binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
      binNum=lastBinIndex;
    }
    if (modelConfig.isRegression()) {
      if (posTags.contains(tag)) {
        binningInfoWritable.getBinCountPos()[binNum]+=1L;
        binningInfoWritable.getBinWeightPos()[binNum]+=weight;
      }
 else       if (negTags.contains(tag)) {
        binningInfoWritable.getBinCountNeg()[binNum]+=1L;
        binningInfoWritable.getBinWeightNeg()[binNum]+=weight;
      }
    }
 else {
      binningInfoWritable.getBinCountPos()[binNum]+=1L;
      binningInfoWritable.getBinWeightPos()[binNum]+=weight;
    }
  }
 else   if (columnConfig.isNumerical()) {
    int lastBinIndex=binningInfoWritable.getBinBoundaries().size();
    double douVal=0.0;
    if (units[columnIndex] == null || units[columnIndex].length() == 0) {
      isMissingValue=true;
    }
 else {
      try {
        douVal=Double.parseDouble(units[columnIndex].trim());
      }
 catch (      Exception e) {
        isInvalidValue=true;
      }
    }
    if (Double.compare(douVal,modelConfig.getNumericalValueThreshold()) > 0) {
      isInvalidValue=true;
    }
    if (isInvalidValue || isMissingValue) {
      binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
      if (modelConfig.isRegression()) {
        if (posTags.contains(tag)) {
          binningInfoWritable.getBinCountPos()[lastBinIndex]+=1L;
          binningInfoWritable.getBinWeightPos()[lastBinIndex]+=weight;
        }
 else         if (negTags.contains(tag)) {
          binningInfoWritable.getBinCountNeg()[lastBinIndex]+=1L;
          binningInfoWritable.getBinWeightNeg()[lastBinIndex]+=weight;
        }
      }
    }
 else {
      int binNum=getBinNum(binningInfoWritable.getBinBoundaries(),units[columnIndex]);
      if (binNum == -1) {
        throw new RuntimeException("String_Node_Str");
      }
      if (modelConfig.isRegression()) {
        if (posTags.contains(tag)) {
          binningInfoWritable.getBinCountPos()[binNum]+=1L;
          binningInfoWritable.getBinWeightPos()[binNum]+=weight;
        }
 else         if (negTags.contains(tag)) {
          binningInfoWritable.getBinCountNeg()[binNum]+=1L;
          binningInfoWritable.getBinWeightNeg()[binNum]+=weight;
        }
      }
      binningInfoWritable.setSum(binningInfoWritable.getSum() + douVal);
      double squaredVal=douVal * douVal;
      binningInfoWritable.setSquaredSum(binningInfoWritable.getSquaredSum() + squaredVal);
      binningInfoWritable.setTripleSum(binningInfoWritable.getTripleSum() + squaredVal * douVal);
      binningInfoWritable.setQuarticSum(binningInfoWritable.getQuarticSum() + squaredVal * squaredVal);
      if (Double.compare(binningInfoWritable.getMax(),douVal) < 0) {
        binningInfoWritable.setMax(douVal);
      }
      if (Double.compare(binningInfoWritable.getMin(),douVal) > 0) {
        binningInfoWritable.setMin(douVal);
      }
    }
  }
}

Fixed version (ground truth):
private void populateStats(String[] units,String tag,Double weight,int columnIndex,int newCCIndex){
  ColumnConfig columnConfig=this.columnConfigList.get(columnIndex);
  CountAndFrequentItems countAndFrequentItems=this.variableCountMap.get(newCCIndex);
  if (countAndFrequentItems == null) {
    countAndFrequentItems=new CountAndFrequentItems();
    this.variableCountMap.put(newCCIndex,countAndFrequentItems);
  }
  countAndFrequentItems.offer(this.missingOrInvalidValues,units[columnIndex]);
  boolean isMissingValue=false;
  boolean isInvalidValue=false;
  BinningInfoWritable binningInfoWritable=this.columnBinningInfo.get(newCCIndex);
  if (binningInfoWritable == null) {
    return;
  }
  binningInfoWritable.setTotalCount(binningInfoWritable.getTotalCount() + 1L);
  if (columnConfig.isHybrid()) {
    int binNum=0;
    if (units[columnIndex] == null || missingOrInvalidValues.contains(units[columnIndex].toLowerCase())) {
      isMissingValue=true;
    }
    String str=StringUtils.trim(units[columnIndex]);
    double douVal=CommonUtils.parseNumber(str);
    Double hybridThreshould=columnConfig.getHybridThreshold();
    if (hybridThreshould == null) {
      hybridThreshould=Double.NEGATIVE_INFINITY;
    }
    boolean isCategory=Double.isNaN(douVal) || douVal < hybridThreshould;
    boolean isNumber=!Double.isNaN(douVal);
    if (isMissingValue) {
      binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
      binNum=binningInfoWritable.getBinCategories().size() + binningInfoWritable.getBinBoundaries().size();
    }
 else     if (isCategory) {
      binNum=quickLocateCategoricalBin(this.categoricalBinMap.get(newCCIndex),str);
      if (binNum < 0) {
        isInvalidValue=true;
      }
      if (isInvalidValue) {
        binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
        binNum=binningInfoWritable.getBinCategories().size() + binningInfoWritable.getBinBoundaries().size();
      }
 else {
        binNum+=binningInfoWritable.getBinBoundaries().size();
        ;
      }
    }
 else     if (isNumber) {
      binNum=getBinNum(binningInfoWritable.getBinBoundaries(),douVal);
      if (binNum == -1) {
        throw new RuntimeException("String_Node_Str");
      }
      binningInfoWritable.setSum(binningInfoWritable.getSum() + douVal);
      double squaredVal=douVal * douVal;
      binningInfoWritable.setSquaredSum(binningInfoWritable.getSquaredSum() + squaredVal);
      binningInfoWritable.setTripleSum(binningInfoWritable.getTripleSum() + squaredVal * douVal);
      binningInfoWritable.setQuarticSum(binningInfoWritable.getQuarticSum() + squaredVal * squaredVal);
      if (Double.compare(binningInfoWritable.getMax(),douVal) < 0) {
        binningInfoWritable.setMax(douVal);
      }
      if (Double.compare(binningInfoWritable.getMin(),douVal) > 0) {
        binningInfoWritable.setMin(douVal);
      }
    }
    if (posTags.contains(tag)) {
      binningInfoWritable.getBinCountPos()[binNum]+=1L;
      binningInfoWritable.getBinWeightPos()[binNum]+=weight;
    }
 else     if (negTags.contains(tag)) {
      binningInfoWritable.getBinCountNeg()[binNum]+=1L;
      binningInfoWritable.getBinWeightNeg()[binNum]+=weight;
    }
  }
 else   if (columnConfig.isCategorical()) {
    int lastBinIndex=binningInfoWritable.getBinCategories().size();
    int binNum=0;
    if (units[columnIndex] == null || missingOrInvalidValues.contains(units[columnIndex].toLowerCase())) {
      isMissingValue=true;
    }
 else {
      String str=StringUtils.trim(units[columnIndex]);
      binNum=quickLocateCategoricalBin(this.categoricalBinMap.get(newCCIndex),str);
      if (binNum < 0) {
        isInvalidValue=true;
      }
    }
    if (isInvalidValue || isMissingValue) {
      binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
      binNum=lastBinIndex;
    }
    if (modelConfig.isRegression()) {
      if (posTags.contains(tag)) {
        binningInfoWritable.getBinCountPos()[binNum]+=1L;
        binningInfoWritable.getBinWeightPos()[binNum]+=weight;
      }
 else       if (negTags.contains(tag)) {
        binningInfoWritable.getBinCountNeg()[binNum]+=1L;
        binningInfoWritable.getBinWeightNeg()[binNum]+=weight;
      }
    }
 else {
      binningInfoWritable.getBinCountPos()[binNum]+=1L;
      binningInfoWritable.getBinWeightPos()[binNum]+=weight;
    }
  }
 else   if (columnConfig.isNumerical()) {
    int lastBinIndex=binningInfoWritable.getBinBoundaries().size();
    double douVal=0.0;
    if (units[columnIndex] == null || units[columnIndex].length() == 0) {
      isMissingValue=true;
    }
 else {
      try {
        douVal=Double.parseDouble(units[columnIndex].trim());
      }
 catch (      Exception e) {
        isInvalidValue=true;
      }
    }
    if (Double.compare(douVal,modelConfig.getNumericalValueThreshold()) > 0) {
      isInvalidValue=true;
    }
    if (isInvalidValue || isMissingValue) {
      binningInfoWritable.setMissingCount(binningInfoWritable.getMissingCount() + 1L);
      if (modelConfig.isRegression()) {
        if (posTags.contains(tag)) {
          binningInfoWritable.getBinCountPos()[lastBinIndex]+=1L;
          binningInfoWritable.getBinWeightPos()[lastBinIndex]+=weight;
        }
 else         if (negTags.contains(tag)) {
          binningInfoWritable.getBinCountNeg()[lastBinIndex]+=1L;
          binningInfoWritable.getBinWeightNeg()[lastBinIndex]+=weight;
        }
      }
    }
 else {
      int binNum=getBinNum(binningInfoWritable.getBinBoundaries(),units[columnIndex]);
      if (binNum == -1) {
        throw new RuntimeException("String_Node_Str");
      }
      if (modelConfig.isRegression()) {
        if (posTags.contains(tag)) {
          binningInfoWritable.getBinCountPos()[binNum]+=1L;
          binningInfoWritable.getBinWeightPos()[binNum]+=weight;
        }
 else         if (negTags.contains(tag)) {
          binningInfoWritable.getBinCountNeg()[binNum]+=1L;
          binningInfoWritable.getBinWeightNeg()[binNum]+=weight;
        }
      }
      binningInfoWritable.setSum(binningInfoWritable.getSum() + douVal);
      double squaredVal=douVal * douVal;
      binningInfoWritable.setSquaredSum(binningInfoWritable.getSquaredSum() + squaredVal);
      binningInfoWritable.setTripleSum(binningInfoWritable.getTripleSum() + squaredVal * douVal);
      binningInfoWritable.setQuarticSum(binningInfoWritable.getQuarticSum() + squaredVal * squaredVal);
      if (Double.compare(binningInfoWritable.getMax(),douVal) < 0) {
        binningInfoWritable.setMax(douVal);
      }
      if (Double.compare(binningInfoWritable.getMin(),douVal) > 0) {
        binningInfoWritable.setMin(douVal);
      }
    }
  }
}