nus-yam/ex-repair huggingface dataset:
Program: 31582
Project: 31582
Buggy source:
public void setTxAddress(long address){
  MappedByteBuffer buffer=mf.getBuffer(0,8);
  buffer.putLong(address);
  byte b0=(byte)address;
  byte b1=(byte)(address >> 8);
  byte b2=(byte)(address >> 16);
  byte b3=(byte)(address >> 24);
  byte b4=(byte)(address >> 32);
  byte b5=(byte)(address >> 40);
  byte b6=(byte)(address >> 48);
  byte b7=(byte)(address >> 56);
  buffer.put((byte)(b0 ^ b1 ^ b2^ b3^ b4^ b5^ b6^ b7));
}

Fixed version (ground truth):
public void setTxAddress(long address){
  MappedByteBuffer buffer=mf.getBuffer(0,9);
  buffer.putLong(address);
  byte b0=(byte)address;
  byte b1=(byte)(address >> 8);
  byte b2=(byte)(address >> 16);
  byte b3=(byte)(address >> 24);
  byte b4=(byte)(address >> 32);
  byte b5=(byte)(address >> 40);
  byte b6=(byte)(address >> 48);
  byte b7=(byte)(address >> 56);
  buffer.put((byte)(b0 ^ b1 ^ b2^ b3^ b4^ b5^ b6^ b7));
}
Program: 31586
Project: 31586
Buggy source:
@Test public void testPartsFile() throws IOException {
  HdfsPartFile hdfsPartFile=new HdfsPartFile("String_Node_Str",SourceType.LOCAL);
  int lineCnt=0;
  String line=null;
  while ((line=hdfsPartFile.readLine()) != null) {
    lineCnt++;
  }
  hdfsPartFile.close();
  Assert.assertEquals(lineCnt,50);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testPartsFile() throws IOException {
  HdfsPartFile hdfsPartFile=new HdfsPartFile("String_Node_Str",SourceType.LOCAL);
  int lineCnt=0;
  String line=null;
  while ((line=hdfsPartFile.readLine()) != null) {
    lineCnt++;
  }
  hdfsPartFile.close();
  Assert.assertEquals(lineCnt,50);
}
Program: 31589
Project: 31589
Buggy source:
/** 
 * Get the varsel auto filter history to let user have the opportunity to change
 * @return
 */
public String getVarSelHistory(){
  return getPathBySourceType(new Path(Constants.TMP,Constants.VAR_SEL_HISTORY),SourceType.LOCAL);
}

Fixed version (ground truth):
/** 
 * Get the varsel auto filter history to let user have the opportunity to change
 * @return - the varsel.history path for variable auto filter
 */
public String getVarSelHistory(){
  return getPathBySourceType(new Path(Constants.TMP,Constants.VAR_SEL_HISTORY),SourceType.LOCAL);
}
Program: 31590
Project: 31590
Buggy source:
/** 
 * Get the shuffle data path according SourceType
 * @param sourceType
 * @return
 */
private String getShuffleDataPath(SourceType sourceType){
  return getPathBySourceType(new Path(Constants.TMP,Constants.SHUFFLED_DATA_PATH),sourceType);
}

Fixed version (ground truth):
/** 
 * Get the shuffle data path according SourceType
 * @param sourceType - Local/HDFS
 * @return - the shuffle data path
 */
private String getShuffleDataPath(SourceType sourceType){
  return getPathBySourceType(new Path(Constants.TMP,Constants.SHUFFLED_DATA_PATH),sourceType);
}
Program: 31591
Project: 31591
Buggy source:
/** 
 * Get the backup ColumnConfig
 * @return
 */
public String getBackupColumnConfig(){
  return getPathBySourceType(new Path(Constants.TMP,Constants.COLUMN_CONFIG_JSON_FILE_NAME),SourceType.LOCAL);
}

Fixed version (ground truth):
/** 
 * Get the backup ColumnConfig
 * @return - the ColumnConfig.json path for backup
 */
public String getBackupColumnConfig(){
  return getPathBySourceType(new Path(Constants.TMP,Constants.COLUMN_CONFIG_JSON_FILE_NAME),SourceType.LOCAL);
}
Program: 31592
Project: 31592
Buggy source:
public String getCorrExportPath(){
  return getPathBySourceType(new Path(Constants.TMP,Constants.CORR_EXPORT_PATH),SourceType.LOCAL);
}

Fixed version (ground truth):
/** 
 * Get the correlation export path
 * @return - the correlation path for export
 */
public String getCorrExportPath(){
  return getPathBySourceType(new Path(Constants.TMP,Constants.CORR_EXPORT_PATH),SourceType.LOCAL);
}
Program: 31593
Project: 31593
Buggy source:
@Override public void updateColumnConfig(ColumnConfig columnConfig){
  String varName=columnConfig.getColumnName();
  columnConfig.setColumnFlag(null);
  if (NSColumnUtils.isColumnEqual(this.targetColumnName,varName)) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Target);
  }
 else   if (this.setMeta.contains(new NSColumn(varName))) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Meta);
  }
 else   if (this.setForceRemove.contains(new NSColumn(varName))) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.ForceRemove);
  }
 else   if (this.setForceSelect.contains(new NSColumn(varName))) {
    if (CollectionUtils.isEmpty(this.setCandidates) || (CollectionUtils.isNotEmpty(this.setCandidates) && this.setCandidates.contains(new NSColumn(varName)))) {
      columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.ForceSelect);
    }
  }
 else   if (NSColumnUtils.isColumnEqual(this.weightColumnName,varName)) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Weight);
  }
 else   if (this.setCandidates.contains(new NSColumn(varName))) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Candidate);
  }
}

Fixed version (ground truth):
@Override public void updateColumnConfig(ColumnConfig columnConfig){
  String varName=columnConfig.getColumnName();
  columnConfig.setColumnFlag(null);
  if (NSColumnUtils.isColumnEqual(this.targetColumnName,varName)) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Target);
  }
 else   if (this.setMeta.contains(new NSColumn(varName))) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Meta);
  }
 else   if (this.setForceRemove.contains(new NSColumn(varName))) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.ForceRemove);
  }
 else   if (this.setForceSelect.contains(new NSColumn(varName))) {
    if (CollectionUtils.isEmpty(this.setCandidates) || (CollectionUtils.isNotEmpty(this.setCandidates) && this.setCandidates.contains(new NSColumn(varName)))) {
      columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.ForceSelect);
    }
  }
 else   if (NSColumnUtils.isColumnEqual(this.weightColumnName,varName)) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Weight);
  }
 else   if (this.setCandidates.contains(new NSColumn(varName))) {
    columnConfig.setColumnFlag(ColumnConfig.ColumnFlag.Candidate);
  }
 else   if (this.setCategorialColumns.contains(new NSColumn(varName))) {
    columnConfig.setColumnType(ColumnType.C);
  }
}
Program: 31594
Project: 31594
Buggy source:
public VarSelUpdater(ModelConfig modelConfig) throws IOException {
  super(modelConfig);
  segs=modelConfig.getSegmentFilterExpressions();
  if (segs.size() > 0) {
    this.isForSegs=true;
  }
  this.setMeta=new HashSet<NSColumn>();
  if (CollectionUtils.isNotEmpty(modelConfig.getMetaColumnNames())) {
    for (    String meta : modelConfig.getMetaColumnNames()) {
      setMeta.add(new NSColumn(meta));
      if (this.isForSegs) {
        for (int i=0; i < segs.size(); i++) {
          setMeta.add(new NSColumn(meta + "String_Node_Str" + (i + 1)));
        }
      }
    }
  }
  setHybridColumns=new HashSet<NSColumn>();
  hybridColumnNames=modelConfig.getHybridColumnNames();
  if (hybridColumnNames != null && hybridColumnNames.size() > 0) {
    for (    Entry<String,Double> entry : hybridColumnNames.entrySet()) {
      setHybridColumns.add(new NSColumn(entry.getKey()));
      if (this.isForSegs) {
        for (int i=0; i < segs.size(); i++) {
          setHybridColumns.add(new NSColumn(entry.getKey() + "String_Node_Str" + (i + 1)));
        }
      }
    }
  }
}

Fixed version (ground truth):
public VarSelUpdater(ModelConfig modelConfig) throws IOException {
  super(modelConfig);
  segs=modelConfig.getSegmentFilterExpressions();
  if (segs.size() > 0) {
    this.isForSegs=true;
  }
  this.setMeta=new HashSet<NSColumn>();
  if (CollectionUtils.isNotEmpty(modelConfig.getMetaColumnNames())) {
    for (    String meta : modelConfig.getMetaColumnNames()) {
      setMeta.add(new NSColumn(meta));
      if (this.isForSegs) {
        for (int i=0; i < segs.size(); i++) {
          setMeta.add(new NSColumn(meta + "String_Node_Str" + (i + 1)));
        }
      }
    }
  }
  this.setCategorialColumns=new HashSet<NSColumn>();
  if (CollectionUtils.isNotEmpty(modelConfig.getCategoricalColumnNames())) {
    for (    String category : modelConfig.getCategoricalColumnNames()) {
      this.setCategorialColumns.add(new NSColumn(category));
      if (this.isForSegs) {
        for (int i=0; i < segs.size(); i++) {
          this.setCategorialColumns.add(new NSColumn(category + "String_Node_Str" + (i + 1)));
        }
      }
    }
  }
  setHybridColumns=new HashSet<NSColumn>();
  hybridColumnNames=modelConfig.getHybridColumnNames();
  if (hybridColumnNames != null && hybridColumnNames.size() > 0) {
    for (    Entry<String,Double> entry : hybridColumnNames.entrySet()) {
      setHybridColumns.add(new NSColumn(entry.getKey()));
      if (this.isForSegs) {
        for (int i=0; i < segs.size(); i++) {
          setHybridColumns.add(new NSColumn(entry.getKey() + "String_Node_Str" + (i + 1)));
        }
      }
    }
  }
}
Program: 31595
Project: 31595
Buggy source:
private long computeDynamicCombineSize() throws IOException {
  String dataPath=null;
  if (CommonUtils.isTreeModel(super.modelConfig.getAlgorithm())) {
    dataPath=super.pathFinder.getCleanedDataPath();
  }
 else {
    dataPath=super.pathFinder.getNormalizedDataPath();
  }
  int filePartCnt=ShifuFileUtils.getFilePartCount(dataPath,SourceType.HDFS);
  long actualFileSize=ShifuFileUtils.getFileOrDirectorySize(dataPath,SourceType.HDFS);
  boolean isGzip=ShifuFileUtils.isPartFileAllGzip(dataPath,SourceType.HDFS);
  long avgFileSize=actualFileSize / filePartCnt;
  if (isGzip && filePartCnt <= 20) {
    return (long)(avgFileSize * 1.2d);
  }
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(modelConfig.getNormalizeType(),this.columnConfigList);
  int candidateCount=inputOutputIndex[2];
  long maxCombineSize=CommonUtils.isTreeModel(modelConfig.getAlgorithm()) ? 209715200L : 168435456L;
  if (modelConfig.isClassification()) {
    return maxCombineSize;
  }
  double ratio=candidateCount / 600d;
  if (ratio > 2d) {
    ratio=0.85 * ratio;
  }
  long finalCombineSize=Double.valueOf((maxCombineSize * 1d * (ratio))).longValue();
  if (finalCombineSize != 0L && actualFileSize / finalCombineSize < 25) {
    finalCombineSize/=2;
  }
  return finalCombineSize;
}

Fixed version (ground truth):
private long computeDynamicCombineSize() throws IOException {
  String dataPath=null;
  if (CommonUtils.isTreeModel(super.modelConfig.getAlgorithm())) {
    dataPath=ShifuFileUtils.getFileSystemBySourceType(modelConfig.getDataSet().getSource()).makeQualified(new Path(super.getPathFinder().getCleanedDataPath())).toString();
  }
 else {
    dataPath=ShifuFileUtils.getFileSystemBySourceType(modelConfig.getDataSet().getSource()).makeQualified(new Path(super.getPathFinder().getNormalizedDataPath())).toString();
  }
  LOG.info("String_Node_Str",dataPath);
  int filePartCnt=ShifuFileUtils.getFilePartCount(dataPath,SourceType.HDFS);
  long actualFileSize=ShifuFileUtils.getFileOrDirectorySize(dataPath,SourceType.HDFS);
  boolean isGzip=ShifuFileUtils.isPartFileAllGzip(dataPath,SourceType.HDFS);
  long avgFileSize=actualFileSize / filePartCnt;
  if (isGzip && filePartCnt <= 20) {
    return (long)(avgFileSize * 1.2d);
  }
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(modelConfig.getNormalizeType(),this.columnConfigList);
  int candidateCount=inputOutputIndex[2];
  long maxCombineSize=CommonUtils.isTreeModel(modelConfig.getAlgorithm()) ? 209715200L : 168435456L;
  if (modelConfig.isClassification()) {
    return maxCombineSize;
  }
  double ratio=candidateCount / 600d;
  if (ratio > 2d) {
    ratio=0.85 * ratio;
  }
  long finalCombineSize=Double.valueOf((maxCombineSize * 1d * (ratio))).longValue();
  if (finalCombineSize != 0L && actualFileSize / finalCombineSize < 25) {
    finalCombineSize/=2;
  }
  return finalCombineSize;
}
Program: 31596
Project: 31596
Buggy source:
public static FileStatus[] getFilePartStatus(String filePath,SourceType sourceType) throws IOException {
  FileSystem fs=getFileSystemBySourceType(sourceType);
  FileStatus[] fileStatsArr=fs.globStatus(new Path(filePath),new PathFilter(){
    @Override public boolean accept(    Path path){
      return path.getName().startsWith("String_Node_Str");
    }
  }
);
  return fileStatsArr;
}

Fixed version (ground truth):
public static FileStatus[] getFilePartStatus(String filePath,SourceType sourceType) throws IOException {
  FileSystem fs=getFileSystemBySourceType(sourceType);
  FileStatus[] fileStatsArr=fs.listStatus(new Path(filePath),new PathFilter(){
    @Override public boolean accept(    Path path){
      return path.getName().startsWith("String_Node_Str");
    }
  }
);
  return fileStatsArr;
}
Program: 31598
Project: 31598
Buggy source:
public RunModelWorker(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,EvalConfig evalConfig,ActorRef parentActorRef,ActorRef nextActorRef) throws IOException {
  super(modelConfig,columnConfigList,parentActorRef,nextActorRef);
  List<BasicML> models=CommonUtils.loadBasicModels(modelConfig,evalConfig,SourceType.LOCAL);
  String[] header=null;
  String delimiter=null;
  if (null == evalConfig || null == evalConfig.getDataSet().getHeaderPath() || null == evalConfig.getDataSet().getHeaderDelimiter()) {
    header=CommonUtils.getFinalHeaders(modelConfig);
    delimiter=modelConfig.getDataSetDelimiter();
  }
 else {
    header=CommonUtils.getFinalHeaders(evalConfig);
    delimiter=evalConfig.getDataSet().getDataDelimiter();
  }
  modelRunner=new ModelRunner(modelConfig,columnConfigList,header,delimiter,models);
  boolean gbtConvertToProp=((evalConfig == null) ? false : evalConfig.getGbtConvertToProb());
  SourceType sourceType=((evalConfig == null) ? modelConfig.getDataSet().getSource() : evalConfig.getDataSet().getSource());
  List<ModelSpec> subModels=CommonUtils.loadSubModels(modelConfig,this.columnConfigList,evalConfig,sourceType,gbtConvertToProp);
  if (CollectionUtils.isNotEmpty(subModels)) {
    for (    ModelSpec modelSpec : subModels) {
      this.modelRunner.addSubModels(modelSpec);
    }
  }
}

Fixed version (ground truth):
public RunModelWorker(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,EvalConfig evalConfig,ActorRef parentActorRef,ActorRef nextActorRef) throws IOException {
  super(modelConfig,columnConfigList,parentActorRef,nextActorRef);
  List<BasicML> models=CommonUtils.loadBasicModels(modelConfig,evalConfig,SourceType.LOCAL);
  String[] header=null;
  String delimiter=null;
  if (null == evalConfig || null == evalConfig.getDataSet().getHeaderPath() || null == evalConfig.getDataSet().getHeaderDelimiter()) {
    header=CommonUtils.getFinalHeaders(modelConfig);
    delimiter=modelConfig.getDataSetDelimiter();
  }
 else {
    header=CommonUtils.getFinalHeaders(evalConfig);
    delimiter=evalConfig.getDataSet().getDataDelimiter();
  }
  modelRunner=new ModelRunner(modelConfig,columnConfigList,header,delimiter,models);
  @SuppressWarnings("String_Node_Str") boolean gbtConvertToProp=((evalConfig == null) ? false : evalConfig.getGbtConvertToProb());
  SourceType sourceType=((evalConfig == null) ? modelConfig.getDataSet().getSource() : evalConfig.getDataSet().getSource());
  List<ModelSpec> subModels=CommonUtils.loadSubModels(modelConfig,this.columnConfigList,evalConfig,sourceType,gbtConvertToProp);
  if (CollectionUtils.isNotEmpty(subModels)) {
    for (    ModelSpec modelSpec : subModels) {
      this.modelRunner.addSubModels(modelSpec);
    }
  }
}
Program: 31599
Project: 31599
Buggy source:
public ScoreModelWorker(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,ActorRef parentActorRef,ActorRef nextActorRef,EvalConfig evalConfig) throws IOException {
  super(modelConfig,columnConfigList,parentActorRef,nextActorRef);
  this.evalConfig=evalConfig;
  PathFinder pathFinder=new PathFinder(modelConfig);
  ShifuFileUtils.createDirIfNotExists(pathFinder.getEvalSetPath(evalConfig),evalConfig.getDataSet().getSource());
  ShifuFileUtils.deleteFile(pathFinder.getEvalScorePath(evalConfig),evalConfig.getDataSet().getSource());
  scoreWriter=ShifuFileUtils.getWriter(pathFinder.getEvalScorePath(evalConfig),evalConfig.getDataSet().getSource());
  header=CommonUtils.getFinalHeaders(evalConfig);
  receivedStreamCnt=0;
  resultMap=new HashMap<Integer,StreamBulletin>();
  subModelsCnt=new TreeMap<String,Integer>();
  List<ModelSpec> subModels=CommonUtils.loadSubModels(modelConfig,this.columnConfigList,evalConfig,evalConfig.getDataSet().getSource(),evalConfig.getGbtConvertToProb());
  if (CollectionUtils.isNotEmpty(subModels)) {
    for (    ModelSpec modelSpec : subModels) {
      System.out.println("String_Node_Str" + modelSpec.getModelName() + "String_Node_Str"+ modelSpec.getModels().size());
      subModelsCnt.put(modelSpec.getModelName(),modelSpec.getModels().size());
    }
  }
  writeScoreHeader();
}

Fixed version (ground truth):
public ScoreModelWorker(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,ActorRef parentActorRef,ActorRef nextActorRef,EvalConfig evalConfig) throws IOException {
  super(modelConfig,columnConfigList,parentActorRef,nextActorRef);
  this.evalConfig=evalConfig;
  PathFinder pathFinder=new PathFinder(modelConfig);
  ShifuFileUtils.createDirIfNotExists(pathFinder.getEvalSetPath(evalConfig),evalConfig.getDataSet().getSource());
  ShifuFileUtils.deleteFile(pathFinder.getEvalScorePath(evalConfig),evalConfig.getDataSet().getSource());
  scoreWriter=ShifuFileUtils.getWriter(pathFinder.getEvalScorePath(evalConfig),evalConfig.getDataSet().getSource());
  header=CommonUtils.getFinalHeaders(evalConfig);
  receivedStreamCnt=0;
  resultMap=new HashMap<Integer,StreamBulletin>();
  subModelsCnt=new TreeMap<String,Integer>();
  @SuppressWarnings("String_Node_Str") List<ModelSpec> subModels=CommonUtils.loadSubModels(modelConfig,this.columnConfigList,evalConfig,evalConfig.getDataSet().getSource(),evalConfig.getGbtConvertToProb());
  if (CollectionUtils.isNotEmpty(subModels)) {
    for (    ModelSpec modelSpec : subModels) {
      System.out.println("String_Node_Str" + modelSpec.getModelName() + "String_Node_Str"+ modelSpec.getModels().size());
      subModelsCnt.put(modelSpec.getModelName(),modelSpec.getModels().size());
    }
  }
  writeScoreHeader();
}
Program: 31600
Project: 31600
Buggy source:
/** 
 * load Column Config
 * @throws IOException in load column config
 */
private void loadColumnConfig() throws IOException {
  columnConfigList=CommonUtils.loadColumnConfigList(new Path(CommonUtils.getLocalModelSetPath(otherConfigs),Constants.LOCAL_COLUMN_CONFIG_JSON).toString(),SourceType.LOCAL);
}

Fixed version (ground truth):
/** 
 * load Column Config
 * @throws IOException in load column config
 */
private void loadColumnConfig() throws IOException {
  columnConfigList=CommonUtils.loadColumnConfigList(new Path(CommonUtils.getLocalModelSetPath(otherConfigs),Constants.LOCAL_COLUMN_CONFIG_JSON).toString(),SourceType.LOCAL,false);
}
Program: 31603
Project: 31603
Buggy source:
public DynamicBinningUDF(String source,String pathModelConfig,String pathColumnConfig,String smallBinsPath) throws IOException {
  super(source,pathModelConfig,pathColumnConfig);
  smallBinsMap=new HashMap<Integer,String>();
  List<String> smallBinsList=ShifuFileUtils.readFilePartsIntoList(smallBinsPath,SourceType.HDFS);
  for (  String smallBin : smallBinsList) {
    String[] fields=StringUtils.split(smallBin,'\u0007');
    if (fields.length == 2) {
      smallBinsMap.put(Integer.parseInt(fields[0]),fields[1]);
    }
  }
}

Fixed version (ground truth):
public DynamicBinningUDF(String source,String pathModelConfig,String pathColumnConfig,String smallBinsPath) throws IOException {
  super(source,pathModelConfig,pathColumnConfig);
  this.smallBinsPath=smallBinsPath;
}
Program: 31604
Project: 31604
Buggy source:
/** 
 * Load column configuration list.
 * @param path file path
 * @param sourceType source type: hdfs or local
 * @return column config list
 * @throws IOException if any IO exception in parsing json.
 * @throws IllegalArgumentException if  {@code path} is null or empty, if sourceType is null.
 */
public static List<ColumnConfig> loadColumnConfigList(String path,SourceType sourceType) throws IOException {
  ColumnConfig[] configList=loadJSON(path,sourceType,ColumnConfig[].class);
  List<ColumnConfig> columnConfigList=new ArrayList<ColumnConfig>();
  for (  ColumnConfig columnConfig : configList) {
    columnConfig.setSampleValues(null);
    columnConfigList.add(columnConfig);
  }
  return columnConfigList;
}

Fixed version (ground truth):
/** 
 * Load column configuration list.
 * @param path file path
 * @param sourceType source type: hdfs or local
 * @param nullSampleValues if sample values null or not to save memory especially in Pig UDF to save more memory. there is a OOM if larger ColumnConfig.json.
 * @return column config list
 * @throws IOException if any IO exception in parsing json.
 * @throws IllegalArgumentException if  {@code path} is null or empty, if sourceType is null.
 */
public static List<ColumnConfig> loadColumnConfigList(String path,SourceType sourceType,boolean nullSampleValues) throws IOException {
  ColumnConfig[] configList=loadJSON(path,sourceType,ColumnConfig[].class);
  List<ColumnConfig> columnConfigList=new ArrayList<ColumnConfig>();
  for (  ColumnConfig columnConfig : configList) {
    if (nullSampleValues) {
      columnConfig.setSampleValues(null);
    }
    columnConfigList.add(columnConfig);
  }
  return columnConfigList;
}
Program: 31606
Project: 31606
Buggy source:
private List<AbstractBinInfo> genNumericalBinInfos(ColumnConfig columnConfig){
  List<AbstractBinInfo> numericalBinInfos=new ArrayList<AbstractBinInfo>();
  for (int i=0; i < columnConfig.getBinBoundary().size(); i++) {
    NumericalBinInfo binInfo=new NumericalBinInfo();
    binInfo.setLeftThreshold(columnConfig.getBinBoundary().get(i));
    if (i == columnConfig.getBinBoundary().size() - 1) {
      binInfo.setRightThreshold(Double.POSITIVE_INFINITY);
    }
 else {
      binInfo.setRightThreshold(columnConfig.getBinBoundary().get(i + 1));
    }
    binInfo.setPositiveCnt(columnConfig.getBinCountPos().get(i));
    binInfo.setNegativeCnt(columnConfig.getBinCountNeg().get(i));
    binInfo.setWeightPos(columnConfig.getBinWeightedPos().get(i));
    binInfo.setWeightNeg(columnConfig.getBinWeightedNeg().get(i));
    numericalBinInfos.add(binInfo);
  }
  return numericalBinInfos;
}

Fixed version (ground truth):
private List<AbstractBinInfo> genNumericalBinInfos(ColumnConfig columnConfig){
  List<AbstractBinInfo> numericalBinInfos=new ArrayList<AbstractBinInfo>();
  if (columnConfig.getBinBoundary() == null) {
    LOG.info("String_Node_Str",columnConfig.getColumnNum(),columnConfig.getColumnName());
  }
  for (int i=0; i < columnConfig.getBinBoundary().size(); i++) {
    NumericalBinInfo binInfo=new NumericalBinInfo();
    binInfo.setLeftThreshold(columnConfig.getBinBoundary().get(i));
    if (i == columnConfig.getBinBoundary().size() - 1) {
      binInfo.setRightThreshold(Double.POSITIVE_INFINITY);
    }
 else {
      binInfo.setRightThreshold(columnConfig.getBinBoundary().get(i + 1));
    }
    binInfo.setPositiveCnt(columnConfig.getBinCountPos().get(i));
    binInfo.setNegativeCnt(columnConfig.getBinCountNeg().get(i));
    binInfo.setWeightPos(columnConfig.getBinWeightedPos().get(i));
    binInfo.setWeightNeg(columnConfig.getBinWeightedNeg().get(i));
    numericalBinInfos.add(binInfo);
  }
  return numericalBinInfos;
}
Program: 31607
Project: 31607
Buggy source:
/** 
 * initialize the config file, pathFinder and other input
 * @param step Shifu running step
 * @throws Exception any exception in setup
 */
protected void setUp(ModelStep step) throws Exception {
  if (hasInitialized()) {
    return;
  }
  loadModelConfig();
  validateModelConfig(step);
  this.pathFinder=new PathFinder(modelConfig,this.getOtherConfigs());
  checkAlgorithmParam();
  LOG.info(String.format("String_Node_Str",modelConfig.getDataSet().getSource()));
switch (step) {
case INIT:
    break;
default :
  loadColumnConfig();
validateColumnConfig();
ColumnConfigUpdater.updateColumnConfigFlags(modelConfig,columnConfigList,step);
validateColumnConfigAfterSet();
saveColumnConfigList();
break;
}
switch (step) {
case NORMALIZE:
case VARSELECT:
case TRAIN:
case EVAL:
List<String> segs=this.modelConfig.getSegmentFilterExpressions();
String alg=this.modelConfig.getAlgorithm();
if (segs.size() > 0 && !(CommonUtils.isNNModel(alg) || CommonUtils.isLRModel(alg))) {
throw new IllegalArgumentException("String_Node_Str");
}
break;
}
}

Fixed version (ground truth):
/** 
 * initialize the config file, pathFinder and other input
 * @param step Shifu running step
 * @throws Exception any exception in setup
 */
protected void setUp(ModelStep step) throws Exception {
  if (hasInitialized()) {
    return;
  }
  loadModelConfig();
  validateModelConfig(step);
  this.pathFinder=new PathFinder(modelConfig,this.getOtherConfigs());
  checkAlgorithmParam();
  LOG.info(String.format("String_Node_Str",modelConfig.getDataSet().getSource()));
switch (step) {
case INIT:
    break;
default :
  loadColumnConfig();
validateColumnConfig();
boolean strictCallVoidUpdate=(step == ModelStep.STATS) && (getBooleanParam(this.params,Constants.IS_COMPUTE_CORR) || getBooleanParam(this.params,Constants.IS_COMPUTE_PSI) || getBooleanParam(this.params,Constants.IS_REBIN));
ColumnConfigUpdater.updateColumnConfigFlags(modelConfig,columnConfigList,step,strictCallVoidUpdate);
validateColumnConfigAfterSet();
saveColumnConfigList();
break;
}
switch (step) {
case NORMALIZE:
case VARSELECT:
case TRAIN:
case EVAL:
List<String> segs=this.modelConfig.getSegmentFilterExpressions();
String alg=this.modelConfig.getAlgorithm();
if (segs.size() > 0 && !(CommonUtils.isNNModel(alg) || CommonUtils.isLRModel(alg))) {
throw new IllegalArgumentException("String_Node_Str");
}
break;
}
}
Program: 31611
Project: 31611
Buggy source:
/** 
 * Update target, listMeta, listForceSelect, listForceRemove
 * @param modelConfig - ModelConfig
 * @param columnConfigList - ColumnConfig list to update
 * @param step - which step is running
 * @throws IOException - error occur, when create updater
 */
public static void updateColumnConfigFlags(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,ModelInspector.ModelStep step) throws IOException {
  BasicUpdater updater=BasicUpdater.getUpdater(modelConfig,step);
  for (  ColumnConfig config : columnConfigList) {
    updater.updateColumnConfig(config);
  }
}

Fixed version (ground truth):
/** 
 * Update target, listMeta, listForceSelect, listForceRemove
 * @param modelConfig - ModelConfig
 * @param columnConfigList - ColumnConfig list to update
 * @param step - which step is running
 * @param directVoidCall - if strictly to call VoidUpdater
 * @throws IOException - error occur, when create updater
 */
public static void updateColumnConfigFlags(ModelConfig modelConfig,List<ColumnConfig> columnConfigList,ModelInspector.ModelStep step,boolean directVoidCall) throws IOException {
  BasicUpdater updater=null;
  if (directVoidCall) {
    updater=new VoidUpdater(modelConfig);
  }
 else {
    updater=BasicUpdater.getUpdater(modelConfig,step);
  }
  for (  ColumnConfig config : columnConfigList) {
    updater.updateColumnConfig(config);
  }
}
Program: 31612
Project: 31612
Buggy source:
private long computeDynamicCombineSize() throws IOException {
  int filePartCnt=ShifuFileUtils.getFilePartCount(super.pathFinder.getNormalizedDataPath(),SourceType.HDFS);
  long actualFileSize=ShifuFileUtils.getFileOrDirectorySize(super.pathFinder.getNormalizedDataPath(),SourceType.HDFS);
  boolean isGzip=ShifuFileUtils.isPartFileAllGzip(this.pathFinder.getNormalizedDataPath(),SourceType.HDFS);
  long avgFileSize=actualFileSize / filePartCnt;
  if (isGzip && filePartCnt <= 20) {
    return (long)(avgFileSize * 1.2d);
  }
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(modelConfig.getNormalizeType(),this.columnConfigList);
  int candidateCount=inputOutputIndex[2];
  long maxCombineSize=CommonUtils.isTreeModel(modelConfig.getAlgorithm()) ? 209715200L : 168435456L;
  if (modelConfig.isClassification()) {
    return maxCombineSize;
  }
  double ratio=candidateCount / 600d;
  if (ratio > 2d) {
    ratio=0.85 * ratio;
  }
  long finalCombineSize=Double.valueOf((maxCombineSize * 1d * (ratio))).longValue();
  if (finalCombineSize != 0L && actualFileSize / finalCombineSize < 25) {
    finalCombineSize/=2;
  }
  return finalCombineSize;
}

Fixed version (ground truth):
private long computeDynamicCombineSize() throws IOException {
  String dataPath=null;
  if (CommonUtils.isTreeModel(super.modelConfig.getAlgorithm())) {
    dataPath=super.pathFinder.getCleanedDataPath();
  }
 else {
    dataPath=super.pathFinder.getNormalizedDataPath();
  }
  int filePartCnt=ShifuFileUtils.getFilePartCount(dataPath,SourceType.HDFS);
  long actualFileSize=ShifuFileUtils.getFileOrDirectorySize(dataPath,SourceType.HDFS);
  boolean isGzip=ShifuFileUtils.isPartFileAllGzip(dataPath,SourceType.HDFS);
  long avgFileSize=actualFileSize / filePartCnt;
  if (isGzip && filePartCnt <= 20) {
    return (long)(avgFileSize * 1.2d);
  }
  int[] inputOutputIndex=DTrainUtils.getInputOutputCandidateCounts(modelConfig.getNormalizeType(),this.columnConfigList);
  int candidateCount=inputOutputIndex[2];
  long maxCombineSize=CommonUtils.isTreeModel(modelConfig.getAlgorithm()) ? 209715200L : 168435456L;
  if (modelConfig.isClassification()) {
    return maxCombineSize;
  }
  double ratio=candidateCount / 600d;
  if (ratio > 2d) {
    ratio=0.85 * ratio;
  }
  long finalCombineSize=Double.valueOf((maxCombineSize * 1d * (ratio))).longValue();
  if (finalCombineSize != 0L && actualFileSize / finalCombineSize < 25) {
    finalCombineSize/=2;
  }
  return finalCombineSize;
}
Program: 31614
Project: 31614
Buggy source:
@SuppressWarnings("String_Node_Str") private void initGradient(FloatMLDataSet training,FloatMLDataSet testing,double[] weights,boolean isCrossOver){
  int numLayers=(Integer)this.validParams.get(CommonConstants.NUM_HIDDEN_LAYERS);
  List<String> actFunc=(List<String>)this.validParams.get(CommonConstants.ACTIVATION_FUNC);
  List<Integer> hiddenNodeList=(List<Integer>)this.validParams.get(CommonConstants.NUM_HIDDEN_NODES);
  BasicNetwork network=DTrainUtils.generateNetwork(this.featureInputsCnt,this.outputNodeCount,numLayers,actFunc,hiddenNodeList,false,this.dropoutRate,this.wgtInit);
  network.getFlat().setWeights(weights);
  FlatNetwork flat=network.getFlat();
  double[] flatSpot=new double[flat.getActivationFunctions().length];
  for (int i=0; i < flat.getActivationFunctions().length; i++) {
    flatSpot[i]=flat.getActivationFunctions()[i] instanceof ActivationSigmoid ? 0.1 : 0.0;
  }
  LOG.info("String_Node_Str",modelConfig.getTrain().getWorkerThreadCount());
  this.gradient=new ParallelGradient((FloatFlatNetwork)flat,training,testing,flatSpot,new LinearErrorFunction(),isCrossOver,modelConfig.getTrain().getWorkerThreadCount(),this.isELM,this.lossStr);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void initGradient(FloatMLDataSet training,FloatMLDataSet testing,double[] weights,boolean isCrossOver){
  int numLayers=(Integer)this.validParams.get(CommonConstants.NUM_HIDDEN_LAYERS);
  List<String> actFunc=(List<String>)this.validParams.get(CommonConstants.ACTIVATION_FUNC);
  List<Integer> hiddenNodeList=(List<Integer>)this.validParams.get(CommonConstants.NUM_HIDDEN_NODES);
  BasicNetwork network=DTrainUtils.generateNetwork(this.featureInputsCnt,this.outputNodeCount,numLayers,actFunc,hiddenNodeList,false,this.dropoutRate,this.wgtInit);
  network.getFlat().setWeights(weights);
  FlatNetwork flat=network.getFlat();
  double[] flatSpot=new double[flat.getActivationFunctions().length];
  for (int i=0; i < flat.getActivationFunctions().length; i++) {
    flatSpot[i]=flat.getActivationFunctions()[i] instanceof ActivationSigmoid ? 0.1 : 0.0;
  }
  LOG.info("String_Node_Str",modelConfig.getTrain().getWorkerThreadCount());
  this.gradient=new ParallelGradient((FloatFlatNetwork)flat,training,testing,flatSpot,new LinearErrorFunction(),isCrossOver,modelConfig.getTrain().getWorkerThreadCount(),this.isELM,this.lossStr,this.batchs);
}
Program: 31616
Project: 31616
Buggy source:
public ParallelGradient(final FloatFlatNetwork theNetwork,final FloatMLDataSet theTraining,final FloatMLDataSet theTesting,final double[] flatSpot,ErrorFunction ef,boolean isCrossOver,int threadCount,boolean isELM,String lossStr){
}

Fixed version (ground truth):
public ParallelGradient(final FloatFlatNetwork theNetwork,final FloatMLDataSet theTraining,final FloatMLDataSet theTesting,final double[] flatSpot,ErrorFunction ef,boolean isCrossOver,int threadCount,boolean isELM,String lossStr,int batchs){
}
Program: 31617
Project: 31617
Buggy source:
public double[] computeGradients(){
  CompletionService<double[]> completionService=new ExecutorCompletionService<double[]>(this.threadPool);
  this.subGradients=new SubGradient[this.threadCount];
  Random dropoutRandom=new Random();
  for (int i=0; i < this.threadCount; i++) {
    if (this.subGradients[i] == null) {
      this.subGradients[i]=new SubGradient(this.network.clone(),this.training,this.trainLows[i],this.trainHighs[i],this.testing,this.testLows[i],this.testHighs[i],this.flatSpot,this.isCrossOver,this,dropoutRandom);
    }
 else {
      this.subGradients[i].setNetwork(this.network.clone());
    }
    this.subGradients[i].setSeed(this.getSeed());
    completionService.submit(this.subGradients[i]);
  }
  int rCnt=0;
  double[] finalGradients=new double[this.getNetwork().getWeights().length];
  while (rCnt < this.threadCount) {
    double[] gradients=null;
    try {
      gradients=completionService.take().get();
    }
 catch (    ExecutionException e) {
      throw new RuntimeException(e);
    }
catch (    InterruptedException e) {
      Thread.currentThread().interrupt();
    }
    for (int i=0; i < finalGradients.length; i++) {
      finalGradients[i]+=gradients[i];
    }
    rCnt+=1;
  }
  double errorSum=0d;
  for (int i=0; i < this.threadCount; i++) {
    errorSum+=this.subGradients[i].getError() * (trainHighs[i] - trainLows[i] + 1) * this.getNetwork().getOutputCount();
  }
  this.trainError=errorSum / (this.training.getRecordCount() * this.getNetwork().getOutputCount());
  return finalGradients;
}

Fixed version (ground truth):
public double[] computeGradients(int currentIteration){
  CompletionService<double[]> completionService=new ExecutorCompletionService<double[]>(this.threadPool);
  this.subGradients=new SubGradient[this.threadCount];
  Random dropoutRandom=new Random();
  for (int i=0; i < this.threadCount; i++) {
    if (this.subGradients[i] == null) {
      this.subGradients[i]=new SubGradient(this.network.clone(),this.training,this.trainLows[i],this.trainHighs[i],this.testing,this.testLows[i],this.testHighs[i],this.flatSpot,this.isCrossOver,this,dropoutRandom,this.batchs,currentIteration);
    }
 else {
      this.subGradients[i].setNetwork(this.network.clone());
    }
    this.subGradients[i].setSeed(this.getSeed());
    completionService.submit(this.subGradients[i]);
  }
  int rCnt=0;
  double[] finalGradients=new double[this.getNetwork().getWeights().length];
  while (rCnt < this.threadCount) {
    double[] gradients=null;
    try {
      gradients=completionService.take().get();
    }
 catch (    ExecutionException e) {
      throw new RuntimeException(e);
    }
catch (    InterruptedException e) {
      Thread.currentThread().interrupt();
    }
    for (int i=0; i < finalGradients.length; i++) {
      finalGradients[i]+=gradients[i];
    }
    rCnt+=1;
  }
  double errorSum=0d;
  for (int i=0; i < this.threadCount; i++) {
    errorSum+=this.subGradients[i].getError() * (trainHighs[i] - trainLows[i] + 1) * this.getNetwork().getOutputCount();
  }
  this.trainError=errorSum / (this.training.getRecordCount() * this.getNetwork().getOutputCount());
  return finalGradients;
}
Program: 31618
Project: 31618
Buggy source:
public SubGradient(final FloatFlatNetwork theNetwork,final FloatMLDataSet theTraining,long trainLow,long trainHigh,final FloatMLDataSet theTesting,long testLow,long testHigh,final double[] flatSpot,boolean isCrossOver,ParallelGradient owner,Random dropoutRandomSource){
  this.network=theNetwork;
  this.training=theTraining;
  this.trainLow=trainLow;
  this.trainHigh=trainHigh;
  this.testing=theTesting;
  this.testLow=testLow;
  this.testHigh=testHigh;
  this.isCrossOver=isCrossOver;
  this.flatSpot=flatSpot;
  this.owner=owner;
  this.errorFunction=this.owner.createEFInstance();
  this.layerDropoutRates=theNetwork.getLayerDropoutRates();
  this.dropoutRandomSource=dropoutRandomSource;
  this.initNetworkParams();
  this.errorCalculation=this.owner.createECInstance();
}

Fixed version (ground truth):
public SubGradient(final FloatFlatNetwork theNetwork,final FloatMLDataSet theTraining,long trainLow,long trainHigh,final FloatMLDataSet theTesting,long testLow,long testHigh,final double[] flatSpot,boolean isCrossOver,ParallelGradient owner,Random dropoutRandomSource,int batchs,int currentInteration){
  this.network=theNetwork;
  this.training=theTraining;
  this.trainLow=trainLow;
  this.trainHigh=trainHigh;
  this.testing=theTesting;
  this.testLow=testLow;
  this.testHigh=testHigh;
  this.isCrossOver=isCrossOver;
  this.flatSpot=flatSpot;
  this.owner=owner;
  this.errorFunction=this.owner.createEFInstance();
  this.layerDropoutRates=theNetwork.getLayerDropoutRates();
  this.dropoutRandomSource=dropoutRandomSource;
  this.initNetworkParams();
  this.errorCalculation=this.owner.createECInstance();
  this.batchs=batchs;
  this.currentIteration=currentInteration;
}
Program: 31619
Project: 31619
Buggy source:
/** 
 * Perform the gradient calculation
 */
public final double[] call(){
  try {
    this.errorCalculation.reset();
    Arrays.fill(this.gradients,0.0);
    for (long i=this.trainLow; i <= this.trainHigh; i++) {
synchronized (this.owner) {
        if (this.isCrossOver) {
          if ((i + seed) % 4 < 3) {
            this.training.getRecord(i,this.pair);
          }
 else {
            long testingSize=this.testing.getRecordCount();
            if (i < testingSize) {
              this.testing.getRecord(i,this.pair);
            }
 else {
              this.testing.getRecord(i % testingSize,this.pair);
            }
          }
        }
 else {
          this.training.getRecord(i,this.pair);
        }
      }
      process(this.pair.getInputArray(),this.pair.getIdealArray(),pair.getSignificance());
    }
    this.error=this.errorCalculation.calculate();
  }
 catch (  final Throwable ex) {
    throw new RuntimeException(ex);
  }
  return this.gradients;
}

Fixed version (ground truth):
/** 
 * Perform the gradient calculation
 */
@Override public final double[] call(){
  try {
    this.errorCalculation.reset();
    Arrays.fill(this.gradients,0.0);
    long start=this.trainLow;
    long end=this.trainHigh;
    if (this.batchs > 1) {
      long currentBatch=(currentIteration - 2) % this.batchs;
      long recordsInBatch=(this.trainHigh - this.trainLow + 1) / this.batchs;
      if (currentBatch == this.batchs - 1) {
        start=this.trainLow + recordsInBatch * currentBatch;
        end=this.trainHigh;
      }
 else {
        start=this.trainLow + recordsInBatch * currentBatch;
        end=this.trainLow + recordsInBatch * (currentBatch + 1) - 1;
      }
      LOG.debug("String_Node_Str",Thread.currentThread().getName(),trainLow,trainHigh,currentIteration,batchs,currentBatch,start,end);
    }
    for (long i=start; i <= end; i++) {
synchronized (this.owner) {
        if (this.isCrossOver) {
          if ((i + seed) % 4 < 3) {
            this.training.getRecord(i,this.pair);
          }
 else {
            long testingSize=this.testing.getRecordCount();
            if (i < testingSize) {
              this.testing.getRecord(i,this.pair);
            }
 else {
              this.testing.getRecord(i % testingSize,this.pair);
            }
          }
        }
 else {
          this.training.getRecord(i,this.pair);
        }
      }
      process(this.pair.getInputArray(),this.pair.getIdealArray(),pair.getSignificance());
    }
    this.error=this.errorCalculation.calculate();
  }
 catch (  final Throwable ex) {
    throw new RuntimeException(ex);
  }
  return this.gradients;
}
Program: 31622
Project: 31622
Buggy source:
@Override protected void reduce(IntWritable key,Iterable<CorrelationWritable> values,Context context) throws IOException, InterruptedException {
  CorrelationWritable finalCw=initCw();
  Iterator<CorrelationWritable> cwIt=values.iterator();
  while (cwIt.hasNext()) {
    CorrelationWritable cw=cwIt.next();
    finalCw.setColumnIndex(cw.getColumnIndex());
    finalCw.combine(cw);
  }
  this.outputKey.set(key.get());
  this.outputValue.set(new String(Base64.encodeBase64(objectToBytes(finalCw)),"String_Node_Str"));
  context.write(outputKey,outputValue);
}

Fixed version (ground truth):
@Override protected void reduce(IntWritable key,Iterable<CorrelationWritable> values,Context context) throws IOException, InterruptedException {
  CorrelationWritable finalCw=null;
  Iterator<CorrelationWritable> cwIt=values.iterator();
  while (cwIt.hasNext()) {
    CorrelationWritable cw=cwIt.next();
    if (finalCw == null) {
      finalCw=initCw(cw.getAdjustCount().length);
    }
    finalCw.setColumnIndex(cw.getColumnIndex());
    finalCw.combine(cw);
  }
  this.outputKey.set(key.get());
  this.outputValue.set(new String(Base64.encodeBase64(objectToBytes(finalCw)),"String_Node_Str"));
  context.write(outputKey,outputValue);
}
Program: 31623
Project: 31623
Buggy source:
private CorrelationWritable initCw(){
  CorrelationWritable finalCw=new CorrelationWritable();
  double[] xySum=new double[this.columnConfigList.size()];
  finalCw.setXySum(xySum);
  double[] xxSum=new double[this.columnConfigList.size()];
  finalCw.setXxSum(xxSum);
  double[] yySum=new double[this.columnConfigList.size()];
  finalCw.setYySum(yySum);
  double[] adjustCount=new double[this.columnConfigList.size()];
  finalCw.setAdjustCount(adjustCount);
  double[] adjustSumX=new double[this.columnConfigList.size()];
  finalCw.setAdjustSumX(adjustSumX);
  double[] adjustSumY=new double[this.columnConfigList.size()];
  finalCw.setAdjustSumY(adjustSumY);
  return finalCw;
}

Fixed version (ground truth):
private CorrelationWritable initCw(int statsCnt){
  CorrelationWritable finalCw=new CorrelationWritable();
  double[] xySum=new double[statsCnt];
  finalCw.setXySum(xySum);
  double[] xxSum=new double[statsCnt];
  finalCw.setXxSum(xxSum);
  double[] yySum=new double[statsCnt];
  finalCw.setYySum(yySum);
  double[] adjustCount=new double[statsCnt];
  finalCw.setAdjustCount(adjustCount);
  double[] adjustSumX=new double[statsCnt];
  finalCw.setAdjustSumX(adjustSumX);
  double[] adjustSumY=new double[statsCnt];
  finalCw.setAdjustSumY(adjustSumY);
  return finalCw;
}
Program: 31624
Project: 31624
Buggy source:
private void loadConfigFiles(final Context context){
  try {
    SourceType sourceType=SourceType.valueOf(context.getConfiguration().get(Constants.SHIFU_MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.columnConfigList=CommonUtils.loadColumnConfigList(context.getConfiguration().get(Constants.SHIFU_COLUMN_CONFIG),sourceType);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void loadConfigFiles(final Context context){
  try {
    SourceType sourceType=SourceType.valueOf(context.getConfiguration().get(Constants.SHIFU_MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.columnConfigList=CommonUtils.loadColumnConfigList(context.getConfiguration().get(Constants.SHIFU_COLUMN_CONFIG),sourceType);
    this.hasCandidates=CommonUtils.hasCandidateColumns(this.columnConfigList);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 31626
Project: 31626
Buggy source:
private void loadConfigFiles(final Context context){
  try {
    SourceType sourceType=SourceType.valueOf(context.getConfiguration().get(Constants.SHIFU_MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.modelConfig=CommonUtils.loadModelConfig(context.getConfiguration().get(Constants.SHIFU_MODEL_CONFIG),sourceType);
    this.columnConfigList=CommonUtils.loadColumnConfigList(context.getConfiguration().get(Constants.SHIFU_COLUMN_CONFIG),sourceType);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void loadConfigFiles(final Context context){
  try {
    SourceType sourceType=SourceType.valueOf(context.getConfiguration().get(Constants.SHIFU_MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.modelConfig=CommonUtils.loadModelConfig(context.getConfiguration().get(Constants.SHIFU_MODEL_CONFIG),sourceType);
    this.columnConfigList=CommonUtils.loadColumnConfigList(context.getConfiguration().get(Constants.SHIFU_COLUMN_CONFIG),sourceType);
    this.hasCandidates=CommonUtils.hasCandidateColumns(this.columnConfigList);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 31628
Project: 31628
Buggy source:
private void loadConfigFiles(final Context context){
  try {
    SourceType sourceType=SourceType.valueOf(context.getConfiguration().get(Constants.SHIFU_MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.modelConfig=CommonUtils.loadModelConfig(context.getConfiguration().get(Constants.SHIFU_MODEL_CONFIG),sourceType);
    this.columnConfigList=CommonUtils.loadColumnConfigList(context.getConfiguration().get(Constants.SHIFU_COLUMN_CONFIG),sourceType);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void loadConfigFiles(final Context context){
  try {
    SourceType sourceType=SourceType.valueOf(context.getConfiguration().get(Constants.SHIFU_MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.modelConfig=CommonUtils.loadModelConfig(context.getConfiguration().get(Constants.SHIFU_MODEL_CONFIG),sourceType);
    this.columnConfigList=CommonUtils.loadColumnConfigList(context.getConfiguration().get(Constants.SHIFU_COLUMN_CONFIG),sourceType);
    this.hasCandidates=CommonUtils.hasCandidateColumns(this.columnConfigList);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 31630
Project: 31630
Buggy source:
/** 
 * Run score only
 * @param config the eval config instance
 * @throws IOException any io exception
 */
private void runScore(EvalConfig config) throws IOException {
  PathFinder pathFinder=new PathFinder(modelConfig);
  String evalSetPath=pathFinder.getEvalSetPath(config,SourceType.LOCAL);
  FileUtils.forceMkdir(new File(evalSetPath));
switch (modelConfig.getBasic().getRunMode()) {
case DIST:
case MAPRED:
    runDistScore(config);
  break;
case LOCAL:
runAkkaScore(config);
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * Run score only
 * @param config the eval config instance
 * @throws IOException any io exception
 */
private void runScore(EvalConfig config) throws IOException {
switch (modelConfig.getBasic().getRunMode()) {
case DIST:
case MAPRED:
    runDistScore(config);
  break;
case LOCAL:
runAkkaScore(config);
break;
default :
break;
}
}
Program: 31631
Project: 31631
Buggy source:
/** 
 * Run evaluation per EvalConfig.
 * @param evalConfig the evaluation config instance.
 * @throws IOException when any IO exception
 */
private void runEval(EvalConfig evalConfig) throws IOException {
synchronized (this) {
    validateEvalColumnConfig(evalConfig);
    String evalSetPath=pathFinder.getEvalSetPath(evalConfig,SourceType.LOCAL);
    FileUtils.forceMkdir(new File(evalSetPath));
  }
  try {
    Thread.sleep(8000);
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
  }
switch (modelConfig.getBasic().getRunMode()) {
case DIST:
case MAPRED:
    runDistEval(evalConfig);
  break;
case LOCAL:
runAkkaEval(evalConfig);
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * Run evaluation per EvalConfig.
 * @param evalConfig the evaluation config instance.
 * @throws IOException when any IO exception
 */
private void runEval(EvalConfig evalConfig) throws IOException {
synchronized (this) {
    validateEvalColumnConfig(evalConfig);
  }
  try {
    Thread.sleep(8000);
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
  }
switch (modelConfig.getBasic().getRunMode()) {
case DIST:
case MAPRED:
    runDistEval(evalConfig);
  break;
case LOCAL:
runAkkaEval(evalConfig);
break;
default :
break;
}
}