Program: 31858
Project: 31858
Buggy source:
@Override public void load(GuaguaWritableAdapter<LongWritable> currentKey,GuaguaWritableAdapter<Text> currentValue,WorkerContext<DTMasterParams,DTWorkerParams> context){
  this.count+=1;
  if ((this.count) % 5000 == 0) {
    LOG.info("String_Node_Str",this.count);
  }
  long hashcode=0;
  short[] inputs=new short[this.inputCount];
  float ideal=0f;
  float significance=1f;
  int index=0, inputIndex=0;
  for (  String input : DEFAULT_SPLITTER.split(currentValue.getWritable().toString())) {
    if (index == this.columnConfigList.size()) {
      significance=input.length() == 0 ? 1f : NumberFormatUtils.getFloat(input,1f);
      if (Float.compare(significance,0f) < 0) {
        LOG.warn("String_Node_Str",count,significance);
        significance=1f;
      }
      break;
    }
 else {
      ColumnConfig columnConfig=this.columnConfigList.get(index);
      if (columnConfig != null && columnConfig.isTarget()) {
        ideal=getFloatValue(input);
      }
 else {
        if (!isAfterVarSelect) {
          if (!columnConfig.isMeta() && !columnConfig.isTarget() && CommonUtils.isGoodCandidate(columnConfig)) {
            if (columnConfig.isNumerical()) {
              float floatValue=getFloatValue(input);
              short binIndex=(short)getBinIndex(floatValue,columnConfig.getBinBoundary());
              inputs[inputIndex]=binIndex;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
 else             if (columnConfig.isCategorical()) {
              short shortValue=(short)(columnConfig.getBinCategory().size());
              if (input.length() == 0) {
                shortValue=(short)(columnConfig.getBinCategory().size());
              }
 else {
                Integer categoricalIndex=this.columnCategoryIndexMapping.get(columnConfig.getColumnNum()).get(input);
                if (categoricalIndex == null) {
                  shortValue=-1;
                }
 else {
                  shortValue=(short)(categoricalIndex.intValue());
                }
                if (shortValue == -1) {
                  shortValue=(short)(columnConfig.getBinCategory().size());
                }
              }
              inputs[inputIndex]=shortValue;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
            hashcode=hashcode * 31 + input.hashCode();
            inputIndex+=1;
          }
        }
 else {
          if (columnConfig != null && !columnConfig.isMeta() && !columnConfig.isTarget() && columnConfig.isFinalSelect()) {
            if (columnConfig.isNumerical()) {
              float floatValue=getFloatValue(input);
              short binIndex=(short)getBinIndex(floatValue,columnConfig.getBinBoundary());
              inputs[inputIndex]=binIndex;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
 else             if (columnConfig.isCategorical()) {
              short shortValue=(short)(columnConfig.getBinCategory().size());
              if (input.length() == 0) {
                shortValue=(short)(columnConfig.getBinCategory().size());
              }
 else {
                Integer categoricalIndex=this.columnCategoryIndexMapping.get(columnConfig.getColumnNum()).get(input);
                if (categoricalIndex == null) {
                  shortValue=-1;
                }
 else {
                  shortValue=(short)(categoricalIndex.intValue());
                }
                if (shortValue == -1) {
                  shortValue=(short)(columnConfig.getBinCategory().size());
                }
              }
              inputs[inputIndex]=shortValue;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
            hashcode=hashcode * 31 + input.hashCode();
            inputIndex+=1;
          }
        }
      }
    }
    index+=1;
  }
  if (this.isOneVsAll) {
    ideal=updateOneVsAllTargetValue(ideal);
  }
  if (modelConfig.getTrain().getSampleNegOnly() && (modelConfig.isRegression() || (modelConfig.isClassification() && modelConfig.getTrain().isOneVsAll())) && Double.compare(ideal + 0.01d,0d) == 0 && (!this.modelConfig.isFixInitialInput() && Double.compare(Math.random(),this.modelConfig.getBaggingSampleRate()) >= 0)) {
    return;
  }
  if (modelConfig.getTrain().getSampleNegOnly() && (modelConfig.isRegression() || (modelConfig.isClassification() && modelConfig.getTrain().isOneVsAll())) && (Double.compare(ideal + 0.01d,0d) == 0 && this.modelConfig.isFixInitialInput() && hashcode % 100 >= Double.valueOf(this.modelConfig.getBaggingSampleRate() * 100).longValue())) {
    return;
  }
  float output=ideal;
  float predict=ideal;
  Data data=new Data(inputs,predict,output,output,significance);
  boolean isValidation=false;
  if (context.getAttachment() != null && context.getAttachment() instanceof Boolean) {
    isValidation=(Boolean)context.getAttachment();
  }
  boolean isInTraining=this.addDataPairToDataSet(hashcode,data,isValidation);
  if (isInTraining) {
    data.subsampleWeights=sampleWeights(data.label);
    if (isPositive(data.label)) {
      this.positiveSelectedTrainCount+=data.subsampleWeights[0] * 1L;
    }
 else {
      this.negativeSelectedTrainCount+=data.subsampleWeights[0] * 1L;
    }
  }
 else {
  }
}

Fixed version (ground truth):
@Override public void load(GuaguaWritableAdapter<LongWritable> currentKey,GuaguaWritableAdapter<Text> currentValue,WorkerContext<DTMasterParams,DTWorkerParams> context){
  this.count+=1;
  if ((this.count) % 5000 == 0) {
    LOG.info("String_Node_Str",this.count);
  }
  long hashcode=0;
  short[] inputs=new short[this.inputCount];
  float ideal=0f;
  float significance=1f;
  int index=0, inputIndex=0;
  for (  String input : DEFAULT_SPLITTER.split(currentValue.getWritable().toString())) {
    if (index == this.columnConfigList.size()) {
      if (StringUtils.isBlank(modelConfig.getWeightColumnName())) {
        significance=1f;
        break;
      }
      significance=input.length() == 0 ? 1f : NumberFormatUtils.getFloat(input,1f);
      if (Float.compare(significance,0f) < 0) {
        LOG.warn("String_Node_Str",count,significance);
        significance=1f;
      }
      break;
    }
 else {
      ColumnConfig columnConfig=this.columnConfigList.get(index);
      if (columnConfig != null && columnConfig.isTarget()) {
        ideal=getFloatValue(input);
      }
 else {
        if (!isAfterVarSelect) {
          if (!columnConfig.isMeta() && !columnConfig.isTarget() && CommonUtils.isGoodCandidate(columnConfig)) {
            if (columnConfig.isNumerical()) {
              float floatValue=getFloatValue(input);
              short binIndex=(short)getBinIndex(floatValue,columnConfig.getBinBoundary());
              inputs[inputIndex]=binIndex;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
 else             if (columnConfig.isCategorical()) {
              short shortValue=(short)(columnConfig.getBinCategory().size());
              if (input.length() == 0) {
                shortValue=(short)(columnConfig.getBinCategory().size());
              }
 else {
                Integer categoricalIndex=this.columnCategoryIndexMapping.get(columnConfig.getColumnNum()).get(input);
                if (categoricalIndex == null) {
                  shortValue=-1;
                }
 else {
                  shortValue=(short)(categoricalIndex.intValue());
                }
                if (shortValue == -1) {
                  shortValue=(short)(columnConfig.getBinCategory().size());
                }
              }
              inputs[inputIndex]=shortValue;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
            hashcode=hashcode * 31 + input.hashCode();
            inputIndex+=1;
          }
        }
 else {
          if (columnConfig != null && !columnConfig.isMeta() && !columnConfig.isTarget() && columnConfig.isFinalSelect()) {
            if (columnConfig.isNumerical()) {
              float floatValue=getFloatValue(input);
              short binIndex=(short)getBinIndex(floatValue,columnConfig.getBinBoundary());
              inputs[inputIndex]=binIndex;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
 else             if (columnConfig.isCategorical()) {
              short shortValue=(short)(columnConfig.getBinCategory().size());
              if (input.length() == 0) {
                shortValue=(short)(columnConfig.getBinCategory().size());
              }
 else {
                Integer categoricalIndex=this.columnCategoryIndexMapping.get(columnConfig.getColumnNum()).get(input);
                if (categoricalIndex == null) {
                  shortValue=-1;
                }
 else {
                  shortValue=(short)(categoricalIndex.intValue());
                }
                if (shortValue == -1) {
                  shortValue=(short)(columnConfig.getBinCategory().size());
                }
              }
              inputs[inputIndex]=shortValue;
              if (!this.inputIndexMap.containsKey(columnConfig.getColumnNum())) {
                this.inputIndexMap.put(columnConfig.getColumnNum(),inputIndex);
              }
            }
            hashcode=hashcode * 31 + input.hashCode();
            inputIndex+=1;
          }
        }
      }
    }
    index+=1;
  }
  if (this.isOneVsAll) {
    ideal=updateOneVsAllTargetValue(ideal);
  }
  if (modelConfig.getTrain().getSampleNegOnly() && (modelConfig.isRegression() || (modelConfig.isClassification() && modelConfig.getTrain().isOneVsAll())) && Double.compare(ideal + 0.01d,0d) == 0 && (!this.modelConfig.isFixInitialInput() && Double.compare(Math.random(),this.modelConfig.getBaggingSampleRate()) >= 0)) {
    return;
  }
  if (modelConfig.getTrain().getSampleNegOnly() && (modelConfig.isRegression() || (modelConfig.isClassification() && modelConfig.getTrain().isOneVsAll())) && (Double.compare(ideal + 0.01d,0d) == 0 && this.modelConfig.isFixInitialInput() && hashcode % 100 >= Double.valueOf(this.modelConfig.getBaggingSampleRate() * 100).longValue())) {
    return;
  }
  float output=ideal;
  float predict=ideal;
  Data data=new Data(inputs,predict,output,output,significance);
  boolean isValidation=false;
  if (context.getAttachment() != null && context.getAttachment() instanceof Boolean) {
    isValidation=(Boolean)context.getAttachment();
  }
  boolean isInTraining=this.addDataPairToDataSet(hashcode,data,isValidation);
  if (isInTraining) {
    data.subsampleWeights=sampleWeights(data.label);
    if (isPositive(data.label)) {
      this.positiveSelectedTrainCount+=data.subsampleWeights[0] * 1L;
    }
 else {
      this.negativeSelectedTrainCount+=data.subsampleWeights[0] * 1L;
    }
  }
 else {
  }
}