nus-yam/ex-repair huggingface dataset:
Program: 32099
Project: 32099
Buggy source:
private void initFieldList(){
  if (requiredFieldList == null) {
    try {
      requiredFieldList=(RequiredFieldList)ObjectSerializer.deserialize(super.props.getProperty("String_Node_Str"));
      LOG.debug("String_Node_Str",requiredFieldList);
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
private void initFieldList(){
  if (requiredFieldList == null) {
    try {
      requiredFieldList=(RequiredFieldList)ObjectSerializer.deserialize(super.props.getProperty("String_Node_Str"));
      LOG.info("String_Node_Str",requiredFieldList);
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 32100
Project: 32100
Buggy source:
/** 
 * Get input nodes number (final select) and output nodes number from column config, and candidate input node number. <p> If number of column in final-select is 0, which means to select all non meta and non target columns. So the input number is set to all candidates.
 * @throws NullPointerException if columnConfigList or ColumnConfig object in columnConfigList is null.
 */
public static int[] getInputOutputCandidateCounts(List<ColumnConfig> columnConfigList){
  int input=0, output=0, candidate=0;
  for (  ColumnConfig config : columnConfigList) {
    if (!config.isTarget() && !config.isMeta()) {
      candidate++;
    }
    if (config.isFinalSelect()) {
      input++;
    }
    if (config.isTarget()) {
      output++;
    }
  }
  return new int[]{input,output,candidate};
}

Fixed version (ground truth):
/** 
 * Get input nodes number (final select) and output nodes number from column config, and candidate input node number. <p> If number of column in final-select is 0, which means to select all non meta and non target columns. So the input number is set to all candidates.
 * @throws NullPointerException if columnConfigList or ColumnConfig object in columnConfigList is null.
 */
public static int[] getInputOutputCandidateCounts(List<ColumnConfig> columnConfigList){
  @SuppressWarnings("String_Node_Str") int input=0, output=0, totalCandidate=0, goodCandidate=0;
  for (  ColumnConfig config : columnConfigList) {
    if (!config.isTarget() && !config.isMeta()) {
      totalCandidate++;
      if (CommonUtils.isGoodCandidate(config)) {
        goodCandidate++;
      }
    }
    if (config.isFinalSelect() && !config.isTarget() && !config.isMeta()) {
      input++;
    }
    if (config.isTarget()) {
      output++;
    }
  }
  return new int[]{input,output,goodCandidate};
}
Program: 32101
Project: 32101
Buggy source:
@Override public void initRecordReader(GuaguaFileSplit fileSplit) throws IOException {
  super.setRecordReader(new GuaguaLineRecordReader());
  super.getRecordReader().initialize(fileSplit);
}

Fixed version (ground truth):
@Override public void initRecordReader(GuaguaFileSplit fileSplit) throws IOException {
  super.setRecordReader(new GuaguaLineRecordReader(fileSplit));
}
Program: 32104
Project: 32104
Buggy source:
public Schema outputSchema(Schema input){
  try {
    StringBuilder schemaStr=new StringBuilder();
    schemaStr.append("String_Node_Str");
    for (int i=0; i < columnConfigList.size(); i++) {
      ColumnConfig config=this.columnConfigList.get(i);
      if (tagColumnNum == i) {
        schemaStr.append(config.getColumnName() + "String_Node_Str" + "String_Node_Str");
      }
 else       if (!config.isMeta()) {
        schemaStr.append(config.getColumnName() + "String_Node_Str" + "String_Node_Str");
      }
 else {
        schemaStr.append(config.getColumnName() + "String_Node_Str" + "String_Node_Str");
      }
    }
    schemaStr.append("String_Node_Str");
    return Utils.getSchemaFromString(schemaStr.toString());
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
public Schema outputSchema(Schema input){
  try {
    StringBuilder schemaStr=new StringBuilder();
    schemaStr.append("String_Node_Str");
    for (int i=0; i < columnConfigList.size(); i++) {
      ColumnConfig config=this.columnConfigList.get(i);
      if (tagColumnNum == i) {
        schemaStr.append(config.getColumnName() + "String_Node_Str" + "String_Node_Str");
      }
 else {
        schemaStr.append(config.getColumnName() + "String_Node_Str" + "String_Node_Str");
      }
    }
    schemaStr.append("String_Node_Str");
    return Utils.getSchemaFromString(schemaStr.toString());
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return null;
  }
}
Program: 32108
Project: 32108
Buggy source:
/** 
 * Compute the normalized data for @NormalizeMethod.MaxMin
 * @param config @ColumnConfig info
 * @param raw input column value
 * @return normalized value for MaxMin method
 */
private static Double getMaxMinScore(ColumnConfig config,String raw){
  if (config.isCategorical()) {
  }
 else {
    Double value=Double.parseDouble(raw);
    return (value - config.getColumnStats().getMin()) / (config.getColumnStats().getMax() - config.getColumnStats().getMin());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Compute the normalized data for @NormalizeMethod.MaxMin
 * @param config
 * @ColumnConfig info
 * @param raw input column value
 * @return normalized value for MaxMin method
 */
private static Double getMaxMinScore(ColumnConfig config,String raw){
  if (config.isCategorical()) {
  }
 else {
    Double value=Double.parseDouble(raw);
    return (value - config.getColumnStats().getMin()) / (config.getColumnStats().getMax() - config.getColumnStats().getMin());
  }
  return null;
}
Program: 32109
Project: 32109
Buggy source:
/** 
 * Parse raw value based on ColumnConfig.
 * @param config @ColumnConfig info
 * @param raw input column value
 * @return parsed raw value. For categorical type, return BinPosRate. For numerical type, returncorresponding double value. For missing data, return default value using {@link Normalizer#defaultMissingValue}.
 */
private static double parseRawValue(ColumnConfig config,String raw){
  double value=0.0;
  if (config.isCategorical()) {
    int index=config.getBinCategory().indexOf(raw);
    if (index == -1) {
      value=defaultMissingValue(config);
    }
 else {
      Double binPosRate=config.getBinPosRate().get(index);
      value=binPosRate == null ? defaultMissingValue(config) : binPosRate.doubleValue();
    }
  }
 else {
    try {
      value=Double.parseDouble(raw);
    }
 catch (    Exception e) {
      log.debug("String_Node_Str" + raw + "String_Node_Str");
      value=defaultMissingValue(config);
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Parse raw value based on ColumnConfig.
 * @param config
 * @ColumnConfig info
 * @param raw input column value
 * @return parsed raw value. For categorical type, return BinPosRate. For numerical type, returncorresponding double value. For missing data, return default value using {@link Normalizer#defaultMissingValue}.
 */
private static double parseRawValue(ColumnConfig config,String raw){
  double value=0.0;
  if (config.isCategorical()) {
    int index=config.getBinCategory().indexOf(raw);
    if (index == -1) {
      value=defaultMissingValue(config);
    }
 else {
      Double binPosRate=config.getBinPosRate().get(index);
      value=binPosRate == null ? defaultMissingValue(config) : binPosRate.doubleValue();
    }
  }
 else {
    try {
      value=Double.parseDouble(raw);
    }
 catch (    Exception e) {
      log.debug("String_Node_Str" + raw + "String_Node_Str");
      value=defaultMissingValue(config);
    }
  }
  return value;
}
Program: 32110
Project: 32110
Buggy source:
/** 
 * Compute the normalized data for Woe Score.
 * @param config @ColumnConfig info
 * @param raw input column value
 * @param isWeightedNorm if use weighted woe
 * @return normalized value for Woe method. For missing value, we return the value in last bin. Since the lastbin refers to the missing value bin.
 */
private static Double woeNormalize(ColumnConfig config,String raw,boolean isWeightedNorm){
  List<Double> woeBins=isWeightedNorm ? config.getBinWeightedWoe() : config.getBinCountWoe();
  int binIndex=CommonUtils.getBinNum(config,raw);
  if (binIndex == -1) {
    return woeBins.get(woeBins.size() - 1);
  }
 else {
    return woeBins.get(binIndex);
  }
}

Fixed version (ground truth):
/** 
 * Compute the normalized data for Woe Score.
 * @param config
 * @ColumnConfig info
 * @param raw input column value
 * @param isWeightedNorm if use weighted woe
 * @return normalized value for Woe method. For missing value, we return the value in last bin. Since the lastbin refers to the missing value bin.
 */
private static Double woeNormalize(ColumnConfig config,String raw,boolean isWeightedNorm){
  List<Double> woeBins=isWeightedNorm ? config.getBinWeightedWoe() : config.getBinCountWoe();
  int binIndex=CommonUtils.getBinNum(config,raw);
  if (binIndex == -1) {
    return woeBins.get(woeBins.size() - 1);
  }
 else {
    return woeBins.get(binIndex);
  }
}
Program: 32111
Project: 32111
Buggy source:
/** 
 * Compute the normalized data for hbrid normalize. Use zscore noramlize for numerical data. Use woe normalize for categorical data while use weight woe normalize when isWeightedNorm is true.
 * @param config @ColumnConfig info
 * @param raw input column value
 * @param cutoff standard deviation cut off
 * @param isWeightedNorm if use weighted woe
 * @return normalized value for hybrid method.
 */
private static Double hybridNormalize(ColumnConfig config,String raw,Double cutoff,boolean isWeightedNorm){
  Double normValue;
  if (config.isNumerical()) {
    normValue=zScoreNormalize(config,raw,cutoff);
  }
 else {
    normValue=woeNormalize(config,raw,isWeightedNorm);
  }
  return normValue;
}

Fixed version (ground truth):
/** 
 * Compute the normalized data for hbrid normalize. Use zscore noramlize for numerical data. Use woe normalize for categorical data while use weight woe normalize when isWeightedNorm is true.
 * @param config
 * @ColumnConfig info
 * @param raw input column value
 * @param cutoff standard deviation cut off
 * @param isWeightedNorm if use weighted woe
 * @return normalized value for hybrid method.
 */
private static Double hybridNormalize(ColumnConfig config,String raw,Double cutoff,boolean isWeightedNorm){
  Double normValue;
  if (config.isNumerical()) {
    normValue=zScoreNormalize(config,raw,cutoff);
  }
 else {
    normValue=woeNormalize(config,raw,isWeightedNorm);
  }
  return normValue;
}
Program: 32112
Project: 32112
Buggy source:
/** 
 * Create @Normalizer, according @ColumnConfig and NormalizeMethod NormalizeMethod method will be NormalizeMethod.ZScore
 * @param config @ColumnConfig to create normalizer
 * @param method NormalizMethod to use
 * @param cutoff stand_dev_cutoff to use
 */
public Normalizer(ColumnConfig config,NormalizeMethod method,Double cutoff){
  this.config=config;
  this.method=method;
  this.stdDevCutOff=cutoff;
}

Fixed version (ground truth):
/** 
 * Create @Normalizer, according @ColumnConfig and NormalizeMethod NormalizeMethod method will be NormalizeMethod.ZScore
 * @param config
 * @ColumnConfig to create normalizer
 * @param method NormalizMethod to use
 * @param cutoff stand_dev_cutoff to use
 */
public Normalizer(ColumnConfig config,NormalizeMethod method,Double cutoff){
  this.config=config;
  this.method=method;
  this.stdDevCutOff=cutoff;
}
Program: 32113
Project: 32113
Buggy source:
/** 
 * Normalize the raw data, according the ColumnConfig infomation and normalization type. Currently, the cutoff value doesn't affect the computation of WOE or WEIGHT_WOE type. <p> Noticd: currently OLD_ZSCALE and ZSCALE is implemented with the same process method. </p>
 * @param config ColumnConfig to normalize data
 * @param raw raw input data
 * @param cutoff standard deviation cut off
 * @param type normalization type. {@link ModelNormalizeConf.NormType}
 * @return normalized value. If normType parameter is invalid, then the ZSCALE will be used as default.
 */
public static Double normalize(ColumnConfig config,String raw,Double cutoff,ModelNormalizeConf.NormType type){
switch (type) {
case WOE:
    return woeNormalize(config,raw,false);
case WEIGHT_WOE:
  return woeNormalize(config,raw,true);
case HYBRID:
return hybridNormalize(config,raw,cutoff,false);
case WEIGHT_HYBRID:
return hybridNormalize(config,raw,cutoff,true);
case WOE_ZSCORE:
return woeZScoreNormalize(config,raw,cutoff,false);
case WEIGHT_WOE_ZSCORE:
return woeZScoreNormalize(config,raw,cutoff,true);
case OLD_ZSCALE:
case ZSCALE:
default :
return zScoreNormalize(config,raw,cutoff);
}
}

Fixed version (ground truth):
/** 
 * Normalize the raw data, according the ColumnConfig infomation and normalization type. Currently, the cutoff value doesn't affect the computation of WOE or WEIGHT_WOE type. <p> Noticd: currently OLD_ZSCALE and ZSCALE is implemented with the same process method. </p>
 * @param config ColumnConfig to normalize data
 * @param raw raw input data
 * @param cutoff standard deviation cut off
 * @param type normalization type.  {@link ModelNormalizeConf.NormType}
 * @return normalized value. If normType parameter is invalid, then the ZSCALE will be used as default.
 */
public static Double normalize(ColumnConfig config,String raw,Double cutoff,ModelNormalizeConf.NormType type){
switch (type) {
case WOE:
    return woeNormalize(config,raw,false);
case WEIGHT_WOE:
  return woeNormalize(config,raw,true);
case HYBRID:
return hybridNormalize(config,raw,cutoff,false);
case WEIGHT_HYBRID:
return hybridNormalize(config,raw,cutoff,true);
case WOE_ZSCORE:
return woeZScoreNormalize(config,raw,cutoff,false);
case WEIGHT_WOE_ZSCORE:
return woeZScoreNormalize(config,raw,cutoff,true);
case OLD_ZSCALE:
case ZSCALE:
default :
return zScoreNormalize(config,raw,cutoff);
}
}
Program: 32114
Project: 32114
Buggy source:
/** 
 * Compute the normalized value for woe zscore normalize.Take woe as variable value and using zscore normalizing  to compute zscore of woe.
 * @param config @ColumnConfig info
 * @param raw input column value
 * @param cutoff standard deviation cut off
 * @param isWeightedNorm if use weighted woe
 * @return normalized value for woe zscore method.
 */
private static Double woeZScoreNormalize(ColumnConfig config,String raw,Double cutoff,boolean isWeightedNorm){
  double stdDevCutOff=checkCutOff(cutoff);
  double woe=woeNormalize(config,raw,isWeightedNorm);
  double[] meanAndStdDev=calculateWoeMeanAndStdDev(config,isWeightedNorm);
  return computeZScore(woe,meanAndStdDev[0],meanAndStdDev[1],stdDevCutOff);
}

Fixed version (ground truth):
/** 
 * Compute the normalized value for woe zscore normalize.Take woe as variable value and using zscore normalizing to compute zscore of woe.
 * @param config
 * @ColumnConfig info
 * @param raw input column value
 * @param cutoff standard deviation cut off
 * @param isWeightedNorm if use weighted woe
 * @return normalized value for woe zscore method.
 */
private static Double woeZScoreNormalize(ColumnConfig config,String raw,Double cutoff,boolean isWeightedNorm){
  double stdDevCutOff=checkCutOff(cutoff);
  double woe=woeNormalize(config,raw,isWeightedNorm);
  double[] meanAndStdDev=calculateWoeMeanAndStdDev(config,isWeightedNorm);
  return computeZScore(woe,meanAndStdDev[0],meanAndStdDev[1],stdDevCutOff);
}
Program: 32115
Project: 32115
Buggy source:
/** 
 * Get the default value for missing data.
 * @param config @ColumnConfig info
 * @return default value for missing data. Now simply return Mean value. If mean is null then return 0.
 */
private static double defaultMissingValue(ColumnConfig config){
  return config.getMean() == null ? 0 : config.getMean().doubleValue();
}

Fixed version (ground truth):
/** 
 * Get the default value for missing data.
 * @param config
 * @ColumnConfig info
 * @return default value for missing data. Now simply return Mean value. If mean is null then return 0.
 */
private static double defaultMissingValue(ColumnConfig config){
  return config.getMean() == null ? 0 : config.getMean().doubleValue();
}
Program: 32116
Project: 32116
Buggy source:
/** 
 * Calculate woe mean and woe standard deviation.
 * @param config @ColumnConfig info
 * @param isWeightedNorm if use weighted woe
 * @return an double array contains woe mean and woe standard deviation as order {mean, stdDev}
 */
private static double[] calculateWoeMeanAndStdDev(ColumnConfig config,boolean isWeightedNorm){
  List<Double> woeList=isWeightedNorm ? config.getBinWeightedWoe() : config.getBinCountWoe();
  if (woeList == null || woeList.size() < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int size=woeList.size();
  Double sum=0.0;
  Double squaredSum=0.0;
  for (int i=0; i < size; i++) {
    Double x=woeList.get(i);
    sum+=x;
    squaredSum+=x * x;
  }
  double woeMean=sum / size;
  double woeStdDev=Math.sqrt(Math.abs((squaredSum - (sum * sum) / size) / (size - 1)));
  return new double[]{woeMean,woeStdDev};
}

Fixed version (ground truth):
/** 
 * Calculate woe mean and woe standard deviation.
 * @param config ColumnConfig info
 * @param isWeightedNorm if use weighted woe
 * @return an double array contains woe mean and woe standard deviation as order {mean, stdDev}
 */
private static double[] calculateWoeMeanAndStdDev(ColumnConfig config,boolean isWeightedNorm){
  List<Double> woeList=isWeightedNorm ? config.getBinWeightedWoe() : config.getBinCountWoe();
  if (woeList == null || woeList.size() < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  List<Integer> negCountList=config.getBinCountNeg();
  List<Integer> posCountList=config.getBinCountPos();
  int size=woeList.size();
  double sum=0.0;
  double squaredSum=0.0;
  long totalCount=0;
  for (int i=0; i < size; i++) {
    int count=negCountList.get(i) + posCountList.get(i);
    totalCount+=count;
    double x=woeList.get(i);
    sum+=x * count;
    squaredSum+=x * x * count;
  }
  double woeMean=sum / totalCount;
  double woeStdDev=Math.sqrt(Math.abs((squaredSum - (sum * sum) / totalCount) / (totalCount - 1)));
  return new double[]{woeMean,woeStdDev};
}
Program: 32117
Project: 32117
Buggy source:
/** 
 * Compute the normalized data for @NormalizeMethod.Zscore
 * @param config @ColumnConfig info
 * @param raw input column value
 * @param cutoff standard deviation cut off
 * @return normalized value for ZScore method.
 */
private static Double zScoreNormalize(ColumnConfig config,String raw,Double cutoff){
  double stdDevCutOff=checkCutOff(cutoff);
  double value=parseRawValue(config,raw);
  return computeZScore(value,config.getMean(),config.getStdDev(),stdDevCutOff);
}

Fixed version (ground truth):
/** 
 * Compute the normalized data for @NormalizeMethod.Zscore
 * @param config
 * @ColumnConfig info
 * @param raw input column value
 * @param cutoff standard deviation cut off
 * @return normalized value for ZScore method.
 */
private static Double zScoreNormalize(ColumnConfig config,String raw,Double cutoff){
  double stdDevCutOff=checkCutOff(cutoff);
  double value=parseRawValue(config,raw);
  return computeZScore(value,config.getMean(),config.getStdDev(),stdDevCutOff);
}
Program: 32118
Project: 32118
Buggy source:
@Test public void testIsFileExists() throws IOException {
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertFalse(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
}

Fixed version (ground truth):
public void testIsFileExists() throws IOException {
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertTrue(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
  Assert.assertFalse(ShifuFileUtils.isFileExists("String_Node_Str",SourceType.LOCAL));
}
Program: 32119
Project: 32119
Buggy source:
@Test public void testExpandPath() throws IOException {
  File testDir=new File("String_Node_Str");
  FileUtils.forceMkdir(testDir);
  File tmp0=new File("String_Node_Str");
  File tmp1=new File("String_Node_Str");
  File tmp2=new File("String_Node_Str");
  FileUtils.touch(tmp0);
  FileUtils.touch(tmp1);
  FileUtils.touch(tmp2);
  List<String> filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(3,filePathList.size());
  filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(2,filePathList.size());
  Assert.assertTrue(filePathList.get(0).contains("String_Node_Str"));
  filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(3,filePathList.size());
  Assert.assertTrue(filePathList.get(0).contains("String_Node_Str"));
  filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(0,filePathList.size());
  FileUtils.deleteDirectory(testDir);
}

Fixed version (ground truth):
public void testExpandPath() throws IOException {
  File testDir=new File("String_Node_Str");
  FileUtils.forceMkdir(testDir);
  File tmp0=new File("String_Node_Str");
  File tmp1=new File("String_Node_Str");
  File tmp2=new File("String_Node_Str");
  FileUtils.touch(tmp0);
  FileUtils.touch(tmp1);
  FileUtils.touch(tmp2);
  List<String> filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(3,filePathList.size());
  filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(2,filePathList.size());
  Assert.assertTrue(filePathList.get(0).contains("String_Node_Str"));
  filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(3,filePathList.size());
  Assert.assertTrue(filePathList.get(0).contains("String_Node_Str"));
  filePathList=ShifuFileUtils.expandPath("String_Node_Str",SourceType.LOCAL);
  Assert.assertEquals(0,filePathList.size());
  FileUtils.deleteDirectory(testDir);
}
Program: 32121
Project: 32121
Buggy source:
/** 
 * @return normalize missing value filling type
 */
@JsonIgnore public MissValueFillType getNormalizeMissValueFillType(){
  return normalize.getFillType();
}

Fixed version (ground truth):
/** 
 * @return normalize missing value filling type
 */
@JsonIgnore public MissValueFillType getNormalizeMissValueFillType(){
  return normalize.getMissValueFillType();
}
Program: 32122
Project: 32122
Buggy source:
@Override protected boolean isSplitable(JobContext context,Path file){
  if (file.getName().endsWith(GuaguaMapReduceConstants.BZ2)) {
    return true;
  }
  if (file.getName().endsWith(GZ)) {
    return false;
  }
  CompressionCodec codec=new CompressionCodecFactory(context.getConfiguration()).getCodec(file);
  return codec == null;
}

Fixed version (ground truth):
@Override protected boolean isSplitable(JobContext context,Path file){
  CompressionCodec codec=new CompressionCodecFactory(context.getConfiguration()).getCodec(file);
  return codec == null;
}
Program: 32123
Project: 32123
Buggy source:
/** 
 * Get the progress within the split TODO should be rewrite
 */
public float getProgress(){
  if (start == end) {
    return 0.0f;
  }
 else {
    return Math.min(1.0f,(comsumedSplitSize + (pos - start)) / (float)(this.wholeSize));
  }
}

Fixed version (ground truth):
/** 
 * Get the progress within the split
 */
public float getProgress(){
  if (start == end) {
    return 0.0f;
  }
 else {
    return Math.min(1.0f,(comsumedSplitSize + (pos - start)) / (this.wholeSize));
  }
}
Program: 32125
Project: 32125
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + id + "String_Node_Str"+ columnIdList+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + id + "String_Node_Str"+ columnIdList+ "String_Node_Str";
}
Program: 32127
Project: 32127
Buggy source:
@Override public void doWrite(DataOutput out) throws IOException {
  out.writeInt(this.seedList.size());
  for (  CandidateSeed seed : this.seedList) {
    out.write(seed.getId());
    List<Integer> columnIdList=seed.getColumnIdList();
    out.write(columnIdList.size());
    for (    Integer columnId : columnIdList) {
      out.write(columnId);
    }
  }
}

Fixed version (ground truth):
@Override public void doWrite(DataOutput out) throws IOException {
  out.writeInt(this.seedList.size());
  for (  CandidateSeed seed : this.seedList) {
    out.writeInt(seed.getId());
    List<Integer> columnIdList=seed.getColumnIdList();
    out.writeInt(columnIdList.size());
    for (    Integer columnId : columnIdList) {
      out.writeInt(columnId);
    }
  }
}
Program: 32128
Project: 32128
Buggy source:
/** 
 * Get the method-style name of the property. (UPPER the first character:))
 * @param fildeName
 * @return first character Upper style
 */
private static String getMethodName(String fildeName){
  byte[] items=fildeName.getBytes();
  items[0]=(byte)((char)items[0] - 'a' + 'A');
  return new String(items);
}

Fixed version (ground truth):
/** 
 * Get the method-style name of the property. (UPPER the first character:))
 * @param fieldName
 * @return first character Upper style
 */
private static String getMethodName(String fieldName){
  return StringUtils.capitalize(fieldName);
}
Program: 32129
Project: 32129
Buggy source:
@Override public MetaGroup clone(){
  MetaGroup metaGroup=new MetaGroup();
  metaGroup.setGroup(group);
  if (CollectionUtils.isNotEmpty(metaList)) {
    List<MetaItem> metas=new ArrayList<MetaItem>();
    for (    MetaItem metaItem : metaList) {
      metas.add(metaItem.clone());
    }
    metaGroup.setMetaList(metas);
  }
  return metaGroup;
}

Fixed version (ground truth):
@Override public MetaGroup clone(){
  MetaGroup metaGroup=null;
  try {
    metaGroup=(MetaGroup)super.clone();
  }
 catch (  CloneNotSupportedException e) {
    throw new InternalError(e.toString());
  }
  metaGroup.setGroup(group);
  if (CollectionUtils.isNotEmpty(metaList)) {
    List<MetaItem> metas=new ArrayList<MetaItem>();
    for (    MetaItem metaItem : metaList) {
      metas.add(metaItem.clone());
    }
    metaGroup.setMetaList(metas);
  }
  return metaGroup;
}
Program: 32130
Project: 32130
Buggy source:
@Override public MetaItem clone(){
  MetaItem copy=new MetaItem();
  copy.setName(name);
  copy.setType(type);
  copy.setDefval(defval);
  copy.setMaxLength(maxLength);
  copy.setMinLength(minLength);
  copy.setOptions(options);
  copy.setElementType(elementType);
  if (CollectionUtils.isNotEmpty(element)) {
    List<MetaItem> elementList=new ArrayList<MetaItem>();
    for (    MetaItem meta : element) {
      elementList.add(meta.clone());
    }
    copy.setElement(elementList);
  }
  return copy;
}

Fixed version (ground truth):
@Override public MetaItem clone(){
  MetaItem copy=null;
  try {
    copy=(MetaItem)super.clone();
  }
 catch (  CloneNotSupportedException e) {
    throw new InternalError(e.toString());
  }
  copy.setName(name);
  copy.setType(type);
  copy.setDefval(defval);
  copy.setMaxLength(maxLength);
  copy.setMinLength(minLength);
  copy.setOptions(options);
  copy.setElementType(elementType);
  if (CollectionUtils.isNotEmpty(element)) {
    List<MetaItem> elementList=new ArrayList<MetaItem>();
    for (    MetaItem meta : element) {
      elementList.add(meta.clone());
    }
    copy.setElement(elementList);
  }
  return copy;
}
Program: 32132
Project: 32132
Buggy source:
@Override public void postApplication(MasterContext<VarSelMasterResult,VarSelWorkerResult> context){
  VarSelMasterResult varSelMasterResult=context.getMasterResult();
  List<Integer> results=varSelMasterResult.getColumnIdList();
  LOG.info("String_Node_Str" + results);
  Path out=new Path(context.getProps().getProperty(Constants.VAR_SEL_COLUMN_IDS_OUPUT));
  writeColumnIdsIntoHDFS(out,results);
}

Fixed version (ground truth):
@Override public void postApplication(MasterContext<VarSelMasterResult,VarSelWorkerResult> context){
  VarSelMasterResult varSelMasterResult=context.getMasterResult();
  List<Integer> results=varSelMasterResult.getColumnIdList();
  LOG.info("String_Node_Str" + results);
  String out=context.getProps().getProperty(Constants.VAR_SEL_COLUMN_IDS_OUPUT);
  writeColumnIdsIntoHDFS(out,results);
}
Program: 32133
Project: 32133
Buggy source:
private void writeColumnIdsIntoHDFS(Path path,List<Integer> columnIds){
  PrintWriter pw=null;
  try {
    FSDataOutputStream fos=FileSystem.get(new Configuration()).create(path);
    pw=new PrintWriter(fos);
    pw.println(Integer.toString(columnIds.size()) + "String_Node_Str" + columnIds.toString());
    pw.flush();
  }
 catch (  IOException e) {
    e.printStackTrace();
    LOG.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeStream(pw);
  }
}

Fixed version (ground truth):
private void writeColumnIdsIntoHDFS(String path,List<Integer> columnIds){
  BufferedWriter bw=null;
  try {
    bw=ShifuFileUtils.getWriter(path,SourceType.HDFS);
    bw.write(String.format("String_Node_Str",Integer.toString(columnIds.size()),columnIds.toString()));
    bw.newLine();
    bw.flush();
  }
 catch (  IOException e) {
    e.printStackTrace();
    LOG.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeStream(bw);
  }
}
Program: 32134
Project: 32134
Buggy source:
/** 
 * create HEAD file contain the workspace
 * @param modelName
 * @throws IOException
 */
protected void createHead(String modelName) throws IOException {
  File header=new File(modelName == null ? "String_Node_Str" : modelName + "String_Node_Str");
  if (header.exists())   return;
  BufferedWriter writer=null;
  try {
    header.createNewFile();
    writer=new BufferedWriter(new FileWriter(header));
    writer.write("String_Node_Str");
  }
 catch (  IOException e) {
    log.error("String_Node_Str");
  }
 finally {
    if (writer != null) {
      writer.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * create HEAD file contain the workspace
 * @param modelName
 * @throws IOException
 */
protected void createHead(String modelName) throws IOException {
  File header=new File(modelName == null ? "String_Node_Str" : modelName + "String_Node_Str");
  if (header.exists())   return;
  BufferedWriter writer=null;
  try {
    if (!header.createNewFile()) {
      log.error("String_Node_Str",header.getAbsolutePath());
    }
 else {
      writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(header),Constants.DEFAULT_CHARSET));
      writer.write("String_Node_Str");
    }
  }
 catch (  IOException e) {
    log.error("String_Node_Str");
  }
 finally {
    if (writer != null) {
      writer.close();
    }
  }
}
Program: 32135
Project: 32135
Buggy source:
/** 
 * Create expressions for multi weight settings
 * @param weightExprList
 * @return weight expression map
 */
protected Map<Expression,Double> createExpressionMap(List<WeightAmplifier> weightExprList){
  Map<Expression,Double> ewMap=new HashMap<Expression,Double>();
  if (CollectionUtils.isNotEmpty(weightExprList)) {
    JexlEngine jexl=new JexlEngine();
    for (    WeightAmplifier we : weightExprList) {
      ewMap.put(jexl.createExpression(we.getTargetExpression()),Double.valueOf(we.getTargetWeight()));
    }
  }
  return ewMap;
}

Fixed version (ground truth):
/** 
 * Create expressions for multi weight settings
 * @param weightExprList
 * @return weight expression map
 */
protected Map<Expression,Double> createExpressionMap(List<WeightAmplifier> weightExprList){
  Map<Expression,Double> ewMap=new HashMap<Expression,Double>();
  if (CollectionUtils.isNotEmpty(weightExprList)) {
    JexlEngine jexl=new JexlEngine();
    for (    WeightAmplifier we : weightExprList) {
      ewMap.put(jexl.createExpression(we.getTargetExpression()),we.getTargetWeight());
    }
  }
  return ewMap;
}
Program: 32137
Project: 32137
Buggy source:
/** 
 * From Trainer, the logic is to random choose items in master dataset, but I don't want to load data twice for saving memory. Use this to mock raw random repeat logic. This should be some logic difference because of data are not loaded into data set, not random.
 */
private void mockRandomRepeatData(double crossValidationRate,double random){
  long trainingSize=this.trainingData.getRecordCount();
  long testingSize=this.testingData.getRecordCount();
  long size=trainingSize + testingSize;
  int next=RandomUtils.nextInt((int)size);
  MLDataPair dataPair=new BasicMLDataPair(new BasicMLData(new double[this.inputNodeCount]),new BasicMLData(new double[this.outputNodeCount]));
  if (next >= trainingSize) {
    this.testingData.getRecord(next - trainingSize,dataPair);
  }
 else {
    this.trainingData.getRecord(next,dataPair);
  }
  if (Double.valueOf(random).compareTo(Double.valueOf(crossValidationRate)) < 0) {
    this.testingData.add(dataPair);
  }
 else {
    this.trainingData.add(dataPair);
  }
}

Fixed version (ground truth):
/** 
 * From Trainer, the logic is to random choose items in master dataset, but I don't want to load data twice for saving memory. Use this to mock raw random repeat logic. This should be some logic difference because of data are not loaded into data set, not random.
 */
private void mockRandomRepeatData(double crossValidationRate,double random){
  long trainingSize=this.trainingData.getRecordCount();
  long testingSize=this.testingData.getRecordCount();
  long size=trainingSize + testingSize;
  int next=RandomUtils.nextInt((int)size);
  MLDataPair dataPair=new BasicMLDataPair(new BasicMLData(new double[this.inputNodeCount]),new BasicMLData(new double[this.outputNodeCount]));
  if (next >= trainingSize) {
    this.testingData.getRecord(next - trainingSize,dataPair);
  }
 else {
    this.trainingData.getRecord(next,dataPair);
  }
  if (Double.compare(random,crossValidationRate) < 0) {
    this.testingData.add(dataPair);
  }
 else {
    this.trainingData.add(dataPair);
  }
}
Program: 32138
Project: 32138
Buggy source:
/** 
 * Only baggingWithReplacement is set and size over NNConstants.NN_BAGGING_THRESHOLD, and random value <= 1/size. We choose use existing data to add training data set and testing data set.
 */
private boolean isBaggingReplacementTrigged(double random){
  long trainingSize=this.trainingData.getRecordCount();
  long testingSize=this.testingData.getRecordCount();
  long size=trainingSize + testingSize;
  return this.modelConfig.isBaggingWithReplacement() && (testingSize > 0) && (trainingSize > 0)&& (size > NNConstants.NN_BAGGING_THRESHOLD)&& (Double.valueOf(random).compareTo(Double.valueOf(0.5d)) < 0);
}

Fixed version (ground truth):
/** 
 * Only baggingWithReplacement is set and size over NNConstants.NN_BAGGING_THRESHOLD, and random value <= 1/size. We choose use existing data to add training data set and testing data set.
 */
private boolean isBaggingReplacementTrigged(double random){
  long trainingSize=this.trainingData.getRecordCount();
  long testingSize=this.testingData.getRecordCount();
  long size=trainingSize + testingSize;
  return this.modelConfig.isBaggingWithReplacement() && (testingSize > 0) && (trainingSize > 0)&& (size > NNConstants.NN_BAGGING_THRESHOLD)&& (Double.compare(random,0.5d) < 0);
}
Program: 32139
Project: 32139
Buggy source:
/** 
 * Add data pair to data set according to random number compare with crossValidationRate.
 */
private void addDataPairToDataSet(MLDataPair pair,double crossValidationRate,double random){
  if (Double.valueOf(random).compareTo(Double.valueOf(crossValidationRate)) < 0) {
    this.testingData.add(pair);
  }
 else {
    this.trainingData.add(pair);
  }
}

Fixed version (ground truth):
/** 
 * Add data pair to data set according to random number compare with crossValidationRate.
 */
private void addDataPairToDataSet(MLDataPair pair,double crossValidationRate,double random){
  if (Double.compare(random,crossValidationRate) < 0) {
    this.testingData.add(pair);
  }
 else {
    this.trainingData.add(pair);
  }
}
Program: 32140
Project: 32140
Buggy source:
/** 
 * read the binary average score and update them into column list
 * @param columnConfigList
 * @return
 * @throws IOException
 */
private List<ColumnConfig> updateColumnConfigWithBinAvgScore(List<ColumnConfig> columnConfigList) throws IOException {
  List<Scanner> scanners=ShifuFileUtils.getDataScanners(pathFinder.getBinAvgScorePath(),modelConfig.getDataSet().getSource());
  for (  Scanner scanner : scanners) {
    while (scanner.hasNextLine()) {
      List<Integer> scores=new ArrayList<Integer>();
      String[] raw=scanner.nextLine().split("String_Node_Str");
      int columnNum=Integer.valueOf(raw[0]);
      for (int i=1; i < raw.length; i++) {
        scores.add(Integer.valueOf(raw[i]));
      }
      ColumnConfig config=columnConfigList.get(columnNum);
      config.setBinAvgScore(scores);
    }
  }
  closeScanners(scanners);
  return columnConfigList;
}

Fixed version (ground truth):
/** 
 * read the binary average score and update them into column list
 * @param columnConfigList
 * @return
 * @throws IOException
 */
private List<ColumnConfig> updateColumnConfigWithBinAvgScore(List<ColumnConfig> columnConfigList) throws IOException {
  List<Scanner> scanners=ShifuFileUtils.getDataScanners(pathFinder.getBinAvgScorePath(),modelConfig.getDataSet().getSource());
  for (  Scanner scanner : scanners) {
    while (scanner.hasNextLine()) {
      List<Integer> scores=new ArrayList<Integer>();
      String[] raw=scanner.nextLine().split("String_Node_Str");
      int columnNum=Integer.parseInt(raw[0]);
      for (int i=1; i < raw.length; i++) {
        scores.add(Integer.valueOf(raw[i]));
      }
      ColumnConfig config=columnConfigList.get(columnNum);
      config.setBinAvgScore(scores);
    }
  }
  closeScanners(scanners);
  return columnConfigList;
}
Program: 32141
Project: 32141
Buggy source:
private int persistColumnIds(Path path){
  try {
    List<Scanner> scanners=ShifuFileUtils.getDataScanners(path.toString(),modelConfig.getDataSet().getSource());
    List<Integer> ids=null;
    for (    Scanner scanner : scanners) {
      while (scanner.hasNextLine()) {
        String[] raw=scanner.nextLine().trim().split("String_Node_Str");
        @SuppressWarnings("String_Node_Str") int idSize=Integer.valueOf(raw[0]);
        ids=CommonUtils.stringToIntegerList(raw[1]);
      }
    }
    for (    ColumnConfig config : columnConfigList) {
      if (!config.isForceSelect()) {
        config.setFinalSelect(Boolean.FALSE);
      }
    }
    for (    Integer id : ids) {
      this.columnConfigList.get(id).setFinalSelect(Boolean.TRUE);
    }
    super.saveColumnConfigList();
  }
 catch (  IOException e) {
    e.printStackTrace();
    return -1;
  }
catch (  IllegalArgumentException e) {
    e.printStackTrace();
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
private int persistColumnIds(Path path){
  try {
    List<Scanner> scanners=ShifuFileUtils.getDataScanners(path.toString(),modelConfig.getDataSet().getSource());
    List<Integer> ids=null;
    for (    Scanner scanner : scanners) {
      while (scanner.hasNextLine()) {
        String[] raw=scanner.nextLine().trim().split("String_Node_Str");
        @SuppressWarnings("String_Node_Str") int idSize=Integer.parseInt(raw[0]);
        ids=CommonUtils.stringToIntegerList(raw[1]);
      }
    }
    for (    ColumnConfig config : columnConfigList) {
      if (!config.isForceSelect()) {
        config.setFinalSelect(Boolean.FALSE);
      }
    }
    for (    Integer id : ids) {
      this.columnConfigList.get(id).setFinalSelect(Boolean.TRUE);
    }
    super.saveColumnConfigList();
  }
 catch (  IOException e) {
    e.printStackTrace();
    return -1;
  }
catch (  IllegalArgumentException e) {
    e.printStackTrace();
    return -1;
  }
  return 0;
}
Program: 32142
Project: 32142
Buggy source:
@Override public int compare(Pair o1,Pair o2){
  return Double.valueOf(o2.value.getRms()).compareTo(Double.valueOf(o1.value.getRms()));
}

Fixed version (ground truth):
@Override public int compare(Pair o1,Pair o2){
  return Double.compare(o2.value.getRms(),o1.value.getRms());
}
Program: 32143
Project: 32143
Buggy source:
@Override protected void cleanup(Context context) throws IOException, InterruptedException {
  Collections.sort(this.results,new Comparator<Pair>(){
    @Override public int compare(    Pair o1,    Pair o2){
      return Double.valueOf(o2.value.getRms()).compareTo(Double.valueOf(o1.value.getRms()));
    }
  }
);
  LOG.debug("String_Node_Str",this.results);
  int candidates=0;
  if (Constants.WRAPPER_BY_REMOVE.equalsIgnoreCase(this.wrapperBy) || Constants.WRAPPER_BY_SE.equalsIgnoreCase(this.wrapperBy)) {
    candidates=(int)(this.inputNodeCount * (1.0f - this.wrapperRatio));
  }
 else {
    candidates=(int)(this.inputNodeCount * (this.wrapperRatio));
  }
  for (int i=0; i < this.results.size(); i++) {
    Pair pair=this.results.get(i);
    this.outputKey.set(pair.key + "String_Node_Str");
    if (i < candidates) {
      context.write(this.outputKey,OUTPUT_VALUE);
    }
    StringBuilder sb=new StringBuilder(100);
    sb.append(this.columnConfigList.get((int)pair.key).getColumnName()).append("String_Node_Str").append(pair.value.getMean()).append("String_Node_Str").append(pair.value.getRms()).append("String_Node_Str").append(pair.value.getVariance());
    this.outputValue.set(sb.toString());
    this.mos.write(Constants.SHIFU_VARSELECT_SE_OUTPUT_NAME,this.outputKey,this.outputValue);
  }
  this.mos.close();
}

Fixed version (ground truth):
@Override protected void cleanup(Context context) throws IOException, InterruptedException {
  Collections.sort(this.results,new Comparator<Pair>(){
    @Override public int compare(    Pair o1,    Pair o2){
      return Double.compare(o2.value.getRms(),o1.value.getRms());
    }
  }
);
  LOG.debug("String_Node_Str",this.results);
  int candidates=0;
  if (Constants.WRAPPER_BY_REMOVE.equalsIgnoreCase(this.wrapperBy) || Constants.WRAPPER_BY_SE.equalsIgnoreCase(this.wrapperBy)) {
    candidates=(int)(this.inputNodeCount * (1.0f - this.wrapperRatio));
  }
 else {
    candidates=(int)(this.inputNodeCount * (this.wrapperRatio));
  }
  for (int i=0; i < this.results.size(); i++) {
    Pair pair=this.results.get(i);
    this.outputKey.set(pair.key + "String_Node_Str");
    if (i < candidates) {
      context.write(this.outputKey,OUTPUT_VALUE);
    }
    StringBuilder sb=new StringBuilder(100);
    sb.append(this.columnConfigList.get((int)pair.key).getColumnName()).append("String_Node_Str").append(pair.value.getMean()).append("String_Node_Str").append(pair.value.getRms()).append("String_Node_Str").append(pair.value.getVariance());
    this.outputValue.set(sb.toString());
    this.mos.write(Constants.SHIFU_VARSELECT_SE_OUTPUT_NAME,this.outputKey,this.outputValue);
  }
  this.mos.close();
}
Program: 32144
Project: 32144
Buggy source:
/** 
 * Create expressions for multi weight settings
 * @param weightExprList
 * @return weight expression map
 */
protected Map<Expression,Double> createExpressionMap(List<WeightAmplifier> weightExprList){
  Map<Expression,Double> ewMap=new HashMap<Expression,Double>();
  if (CollectionUtils.isNotEmpty(weightExprList)) {
    JexlEngine jexl=new JexlEngine();
    for (    WeightAmplifier we : weightExprList) {
      ewMap.put(jexl.createExpression(we.getTargetExpression()),Double.valueOf(we.getTargetWeight()));
    }
  }
  return ewMap;
}

Fixed version (ground truth):
/** 
 * Create expressions for multi weight settings
 * @param weightExprList
 * @return weight expression map
 */
protected Map<Expression,Double> createExpressionMap(List<WeightAmplifier> weightExprList){
  Map<Expression,Double> ewMap=new HashMap<Expression,Double>();
  if (CollectionUtils.isNotEmpty(weightExprList)) {
    JexlEngine jexl=new JexlEngine();
    for (    WeightAmplifier we : weightExprList) {
      ewMap.put(jexl.createExpression(we.getTargetExpression()),we.getTargetWeight());
    }
  }
  return ewMap;
}
Program: 32145
Project: 32145
Buggy source:
@Test public void testFilter(){
  modelConfig.getVarSelect().setFilterBy("String_Node_Str");
  VariableSelector selector=new VariableSelector(modelConfig,columnConfigList);
  List<ColumnConfig> selected=selector.selectByFilter();
  Integer i=0;
  for (  ColumnConfig config : selected) {
    if (config.isFinalSelect())     i++;
  }
  Assert.assertEquals(i,Integer.valueOf(modelConfig.getVarSelectFilterNum()));
  modelConfig.getVarSelect().setFilterBy("String_Node_Str");
  selector=new VariableSelector(modelConfig,columnConfigList);
  selector.selectByFilter();
  Assert.assertEquals(i,Integer.valueOf(modelConfig.getVarSelectFilterNum()));
  modelConfig.getVarSelect().setFilterBy("String_Node_Str");
  selector=new VariableSelector(modelConfig,columnConfigList);
  selector.selectByFilter();
  Assert.assertEquals(i,Integer.valueOf(modelConfig.getVarSelectFilterNum()));
}

Fixed version (ground truth):
@Test public void testFilter(){
  modelConfig.getVarSelect().setFilterBy("String_Node_Str");
  VariableSelector selector=new VariableSelector(modelConfig,columnConfigList);
  List<ColumnConfig> selected=selector.selectByFilter();
  Integer i=0;
  for (  ColumnConfig config : selected) {
    if (config.isFinalSelect())     i++;
  }
  Assert.assertEquals(i,modelConfig.getVarSelectFilterNum());
  modelConfig.getVarSelect().setFilterBy("String_Node_Str");
  selector=new VariableSelector(modelConfig,columnConfigList);
  selector.selectByFilter();
  Assert.assertEquals(i,Integer.valueOf(modelConfig.getVarSelectFilterNum()));
  modelConfig.getVarSelect().setFilterBy("String_Node_Str");
  selector=new VariableSelector(modelConfig,columnConfigList);
  selector.selectByFilter();
  Assert.assertEquals(i,Integer.valueOf(modelConfig.getVarSelectFilterNum()));
}
Program: 32146
Project: 32146
Buggy source:
/** 
 * Constructor for Integration API, if user use this constructor to construct @ModelRunner, only compute(Map<String, String> rawDataMap) is supported to call. That means client is responsible for preparing the input data map.
 * @param columnConfigList - @ColumnConfig list for Model
 * @param models           - models
 * @param stdDevCutoff     - the standard deviation cutoff to normalize data
 */
public ModelRunner(List<ColumnConfig> columnConfigList,List<BasicML> models,double stdDevCutoff){
  this.columnConfigList=columnConfigList;
  this.scorer=new Scorer(models,columnConfigList,ALGORITHM.NN.name(),stdDevCutoff);
}

Fixed version (ground truth):
/** 
 * Constructor for Integration API, if user use this constructor to construct @ModelRunner, only compute(Map<String, String> rawDataMap) is supported to call. That means client is responsible for preparing the input data map.
 * @param columnConfigList - @ColumnConfig list for Model
 * @param models - models
 * @param stdDevCutoff - the standard deviation cutoff to normalize data
 */
public ModelRunner(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,List<BasicML> models,double stdDevCutoff){
  this.columnConfigList=columnConfigList;
  this.modelConfig=modelConfig;
  this.scorer=new Scorer(models,columnConfigList,ALGORITHM.NN.name(),modelConfig,stdDevCutoff);
}
Program: 32147
Project: 32147
Buggy source:
public Scorer(List<BasicML> models,List<ColumnConfig> columnConfigList,String algorithm,Double cutoff){
  this.models=models;
  this.columnConfigList=columnConfigList;
  this.cutoff=cutoff;
  this.alg=algorithm;
}

Fixed version (ground truth):
public Scorer(List<BasicML> models,List<ColumnConfig> columnConfigList,String algorithm,ModelConfig modelConfig,Double cutoff){
  this.models=models;
  this.columnConfigList=columnConfigList;
  this.cutoff=cutoff;
  this.alg=algorithm;
  this.modelConfig=modelConfig;
}