Program: 32032
Project: 32032
Buggy source:
@Override public void load(GuaguaWritableAdapter<LongWritable> currentKey,GuaguaWritableAdapter<Text> currentValue,WorkerContext<NNParams,NNParams> workerContext){
  super.count+=1;
  if ((super.count) % 100000 == 0) {
    LOG.info("String_Node_Str",super.count);
  }
  double baggingSampleRate=super.modelConfig.getBaggingSampleRate();
  if (!super.modelConfig.isFixInitialInput() && Double.compare(Math.random(),baggingSampleRate) >= 0) {
    return;
  }
  float[] inputs=new float[super.inputNodeCount];
  float[] ideal=new float[super.outputNodeCount];
  if (super.isDry) {
    addDataPairToDataSet(0,new BasicFloatMLDataPair(new BasicFloatMLData(inputs),new BasicFloatMLData(ideal)));
    return;
  }
  long hashcode=0;
  float significance=1f;
  int index=0, inputsIndex=0, outputIndex=0;
  for (  String input : DEFAULT_SPLITTER.split(currentValue.getWritable().toString())) {
    float floatValue=NumberFormatUtils.getFloat(input.trim(),0f);
    if (Float.isNaN(floatValue) || Double.isNaN(floatValue)) {
      floatValue=0f;
    }
    if (index == super.columnConfigList.size()) {
      significance=NumberFormatUtils.getFloat(input,1f);
      break;
    }
 else {
      ColumnConfig columnConfig=super.columnConfigList.get(index);
      if (columnConfig != null && columnConfig.isTarget()) {
        if (modelConfig.isRegression()) {
          ideal[outputIndex++]=floatValue;
        }
 else {
          int ideaIndex=(int)floatValue;
          ideal[ideaIndex]=1f;
        }
      }
 else {
        if (super.inputNodeCount == super.candidateCount) {
          if (!columnConfig.isMeta() && !columnConfig.isTarget() && CommonUtils.isGoodCandidate(columnConfig)) {
            inputs[inputsIndex++]=floatValue;
            hashcode=hashcode * 31 + Double.valueOf(floatValue).hashCode();
          }
        }
 else {
          if (columnConfig != null && !columnConfig.isMeta() && !columnConfig.isTarget() && columnConfig.isFinalSelect()) {
            inputs[inputsIndex++]=floatValue;
            hashcode=hashcode * 31 + Double.valueOf(floatValue).hashCode();
          }
        }
      }
    }
    index+=1;
  }
  long longBaggingSampleRate=Double.valueOf(baggingSampleRate * 100).longValue();
  if (super.modelConfig.isFixInitialInput() && hashcode % 100 >= longBaggingSampleRate) {
    return;
  }
  super.sampleCount+=1;
  FloatMLDataPair pair=new BasicFloatMLDataPair(new BasicFloatMLData(inputs),new BasicFloatMLData(ideal));
  if (modelConfig.isRegression() && isUpSampleEnabled() && Double.compare(ideal[0],1d) == 0) {
    pair.setSignificance(significance * (super.upSampleRng.sample() + 1));
  }
 else {
    pair.setSignificance(significance);
  }
  addDataPairToDataSet(hashcode,pair);
}

Fixed version (ground truth):
@Override public void load(GuaguaWritableAdapter<LongWritable> currentKey,GuaguaWritableAdapter<Text> currentValue,WorkerContext<NNParams,NNParams> workerContext){
  super.count+=1;
  if ((super.count) % 5000 == 0) {
    LOG.info("String_Node_Str",super.count);
  }
  double baggingSampleRate=super.modelConfig.getBaggingSampleRate();
  if (!super.modelConfig.isFixInitialInput() && Double.compare(Math.random(),baggingSampleRate) >= 0) {
    return;
  }
  float[] inputs=new float[super.inputNodeCount];
  float[] ideal=new float[super.outputNodeCount];
  if (super.isDry) {
    addDataPairToDataSet(0,new BasicFloatMLDataPair(new BasicFloatMLData(inputs),new BasicFloatMLData(ideal)));
    return;
  }
  long hashcode=0;
  float significance=1f;
  int index=0, inputsIndex=0, outputIndex=0;
  for (  String input : DEFAULT_SPLITTER.split(currentValue.getWritable().toString())) {
    float floatValue=0f;
    if (input.length() == 0) {
      floatValue=0f;
    }
 else {
      floatValue=NumberFormatUtils.getFloat(input,0f);
    }
    if (Float.isNaN(floatValue) || Double.isNaN(floatValue)) {
      floatValue=0f;
    }
    if (index == super.columnConfigList.size()) {
      if (input.length() == 0) {
        significance=1f;
      }
 else {
        significance=NumberFormatUtils.getFloat(input,1f);
      }
      break;
    }
 else {
      ColumnConfig columnConfig=super.columnConfigList.get(index);
      if (columnConfig != null && columnConfig.isTarget()) {
        if (modelConfig.isRegression()) {
          ideal[outputIndex++]=floatValue;
        }
 else {
          int ideaIndex=(int)floatValue;
          ideal[ideaIndex]=1f;
        }
      }
 else {
        if (super.inputNodeCount == super.candidateCount) {
          if (!columnConfig.isMeta() && !columnConfig.isTarget() && CommonUtils.isGoodCandidate(columnConfig)) {
            inputs[inputsIndex++]=floatValue;
            hashcode=hashcode * 31 + Double.valueOf(floatValue).hashCode();
          }
        }
 else {
          if (columnConfig != null && !columnConfig.isMeta() && !columnConfig.isTarget() && columnConfig.isFinalSelect()) {
            inputs[inputsIndex++]=floatValue;
            hashcode=hashcode * 31 + Double.valueOf(floatValue).hashCode();
          }
        }
      }
    }
    index+=1;
  }
  long longBaggingSampleRate=Double.valueOf(baggingSampleRate * 100).longValue();
  if (super.modelConfig.isFixInitialInput() && hashcode % 100 >= longBaggingSampleRate) {
    return;
  }
  super.sampleCount+=1;
  FloatMLDataPair pair=new BasicFloatMLDataPair(new BasicFloatMLData(inputs),new BasicFloatMLData(ideal));
  if (modelConfig.isRegression() && isUpSampleEnabled() && Double.compare(ideal[0],1d) == 0) {
    pair.setSignificance(significance * (super.upSampleRng.sample() + 1));
  }
 else {
    pair.setSignificance(significance);
  }
  addDataPairToDataSet(hashcode,pair);
}