nus-yam/ex-repair huggingface dataset:
Program: 32048
Project: 32048
Buggy source:
/** 
 * Create a new RGB file.
 * @param theInputCount The input count.
 * @param theIdealCount The ideal count.
 */
public final void create(final int theInputCount,final int theIdealCount){
  try {
    this.inputCount=theInputCount;
    this.idealCount=theIdealCount;
    final float[] input=new float[inputCount];
    final float[] ideal=new float[idealCount];
    this.file.delete();
    this.raf=new RandomAccessFile(this.file,"String_Node_Str");
    this.fc=this.raf.getChannel();
    this.headerBuffer.clear();
    this.headerBuffer.order(ByteOrder.LITTLE_ENDIAN);
    this.headerBuffer.put((byte)'E');
    this.headerBuffer.put((byte)'N');
    this.headerBuffer.put((byte)'C');
    this.headerBuffer.put((byte)'O');
    this.headerBuffer.put((byte)'G');
    this.headerBuffer.put((byte)'-');
    this.headerBuffer.put((byte)'0');
    this.headerBuffer.put((byte)'0');
    this.headerBuffer.putFloat(input.length);
    this.headerBuffer.putFloat(ideal.length);
    this.numberOfRecords=0;
    this.recordCount=this.inputCount + this.idealCount + 1;
    this.recordSize=this.recordCount * EncogFloatEGBFile.FLOAT_SIZE;
    this.recordBuffer=ByteBuffer.allocate(this.recordSize);
    this.headerBuffer.flip();
    this.fc.write(this.headerBuffer);
  }
 catch (  final IOException ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Create a new RGB file.
 * @param theInputCount The input count.
 * @param theIdealCount The ideal count.
 */
public final void create(final int theInputCount,final int theIdealCount){
  try {
    this.inputCount=theInputCount;
    this.idealCount=theIdealCount;
    final float[] input=new float[inputCount];
    final float[] ideal=new float[idealCount];
    boolean delete=this.file.delete();
    if (!delete) {
      throw new IOException("String_Node_Str");
    }
    this.raf=new RandomAccessFile(this.file,"String_Node_Str");
    this.fc=this.raf.getChannel();
    this.headerBuffer.clear();
    this.headerBuffer.order(ByteOrder.LITTLE_ENDIAN);
    this.headerBuffer.put((byte)'E');
    this.headerBuffer.put((byte)'N');
    this.headerBuffer.put((byte)'C');
    this.headerBuffer.put((byte)'O');
    this.headerBuffer.put((byte)'G');
    this.headerBuffer.put((byte)'-');
    this.headerBuffer.put((byte)'0');
    this.headerBuffer.put((byte)'0');
    this.headerBuffer.putFloat(input.length);
    this.headerBuffer.putFloat(ideal.length);
    this.numberOfRecords=0;
    this.recordCount=this.inputCount + this.idealCount + 1;
    this.recordSize=this.recordCount * EncogFloatEGBFile.FLOAT_SIZE;
    this.recordBuffer=ByteBuffer.allocate(this.recordSize);
    this.headerBuffer.flip();
    this.fc.write(this.headerBuffer);
  }
 catch (  final IOException ex) {
    throw new RuntimeException(ex);
  }
}
Program: 32050
Project: 32050
Buggy source:
@Override public void postApplication(MasterContext<VarSelMasterResult,VarSelWorkerResult> context){
  VarSelMasterResult varSelMasterResult=context.getMasterResult();
  @SuppressWarnings("String_Node_Str") List<CandidateSeed> candidateSeeds=varSelMasterResult.getSeedList();
  LOG.info("String_Node_Str",varSelMasterResult.getBestSeed());
  String out=context.getProps().getProperty(Constants.VAR_SEL_COLUMN_IDS_OUPUT);
  writeColumnIdsIntoHDFS(out,varSelMasterResult.getBestSeed().getColumnIdList());
}

Fixed version (ground truth):
@Override public void postApplication(MasterContext<VarSelMasterResult,VarSelWorkerResult> context){
  VarSelMasterResult varSelMasterResult=context.getMasterResult();
  LOG.info("String_Node_Str",varSelMasterResult.getBestSeed());
  String out=context.getProps().getProperty(Constants.VAR_SEL_COLUMN_IDS_OUPUT);
  writeColumnIdsIntoHDFS(out,varSelMasterResult.getBestSeed().getColumnIdList());
}
Program: 32051
Project: 32051
Buggy source:
private List<CandidatePerf> getIndividual(Iterable<VarSelWorkerResult> workerResults){
  Map<Integer,List<Double>> errorMap=new HashMap<Integer,List<Double>>();
  for (  VarSelWorkerResult workerResult : workerResults) {
    List<CandidatePerf> seedPerfList=workerResult.getSeedPerfList();
    for (    CandidatePerf perf : seedPerfList) {
      if (!errorMap.containsKey(perf.getId())) {
        errorMap.put(perf.getId(),new ArrayList<Double>());
      }
      errorMap.get(perf.getId()).add(perf.getVerror());
    }
  }
  List<CandidatePerf> perfs=new ArrayList<CandidatePerf>(errorMap.size());
  for (  Integer id : errorMap.keySet()) {
    double vError=mean(errorMap.get(id));
    perfs.add(new CandidatePerf(id,vError));
  }
  return perfs;
}

Fixed version (ground truth):
private List<CandidatePerf> getIndividual(Iterable<VarSelWorkerResult> workerResults){
  Map<Integer,List<Double>> errorMap=new HashMap<Integer,List<Double>>();
  for (  VarSelWorkerResult workerResult : workerResults) {
    List<CandidatePerf> seedPerfList=workerResult.getSeedPerfList();
    for (    CandidatePerf perf : seedPerfList) {
      if (!errorMap.containsKey(perf.getId())) {
        errorMap.put(perf.getId(),new ArrayList<Double>());
      }
      errorMap.get(perf.getId()).add(perf.getVerror());
    }
  }
  List<CandidatePerf> perfs=new ArrayList<CandidatePerf>(errorMap.size());
  for (  Entry<Integer,List<Double>> entry : errorMap.entrySet()) {
    double vError=mean(entry.getValue());
    perfs.add(new CandidatePerf(entry.getKey(),vError));
  }
  return perfs;
}
Program: 32052
Project: 32052
Buggy source:
/** 
 * Calculate the PSI
 * @throws IOException
 */
private void runPSI() throws IOException {
  if (StringUtils.isNotEmpty(modelConfig.getPSIColumnName())) {
    ColumnConfig columnConfig=CommonUtils.findColumnConfigByName(columnConfigList,modelConfig.getPSIColumnName());
    if (columnConfig == null || !columnConfig.isMeta()) {
      log.warn("String_Node_Str");
      return;
    }
    log.info("String_Node_Str",columnConfig.getColumnName());
    Map<String,String> paramsMap=new HashMap<String,String>();
    paramsMap.put("String_Node_Str",CommonUtils.escapePigString(modelConfig.getDataSetDelimiter()));
    paramsMap.put("String_Node_Str",modelConfig.getPSIColumnName().trim());
    paramsMap.put("String_Node_Str","String_Node_Str");
    PigExecutor.getExecutor().submitJob(modelConfig,pathFinder.getAbsolutePath("String_Node_Str"),paramsMap);
    List<Scanner> scanners=ShifuFileUtils.getDataScanners(pathFinder.getPSIInfoPath(),modelConfig.getDataSet().getSource());
    for (    Scanner scanner : scanners) {
      while (scanner.hasNext()) {
        String[] output=scanner.nextLine().trim().split("String_Node_Str");
        try {
          int columnNum=Integer.parseInt(output[0]);
          ColumnConfig config=this.columnConfigList.get(columnNum);
          config.setPSI(Double.parseDouble(output[1]));
        }
 catch (        Exception e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the PSI
 * @throws IOException
 */
private void runPSI() throws IOException {
  if (StringUtils.isNotEmpty(modelConfig.getPSIColumnName())) {
    ColumnConfig columnConfig=CommonUtils.findColumnConfigByName(columnConfigList,modelConfig.getPSIColumnName());
    if (columnConfig == null || !columnConfig.isMeta()) {
      log.warn("String_Node_Str");
      return;
    }
    log.info("String_Node_Str",columnConfig.getColumnName());
    Map<String,String> paramsMap=new HashMap<String,String>();
    paramsMap.put("String_Node_Str",CommonUtils.escapePigString(modelConfig.getDataSetDelimiter()));
    paramsMap.put("String_Node_Str",modelConfig.getPSIColumnName().trim());
    paramsMap.put("String_Node_Str","String_Node_Str");
    PigExecutor.getExecutor().submitJob(modelConfig,pathFinder.getAbsolutePath("String_Node_Str"),paramsMap);
    List<Scanner> scanners=ShifuFileUtils.getDataScanners(pathFinder.getPSIInfoPath(),modelConfig.getDataSet().getSource());
    for (    Scanner scanner : scanners) {
      while (scanner.hasNext()) {
        String[] output=scanner.nextLine().trim().split("String_Node_Str");
        try {
          int columnNum=Integer.parseInt(output[0]);
          ColumnConfig config=this.columnConfigList.get(columnNum);
          config.setPSI(Double.parseDouble(output[1]));
        }
 catch (        Exception e) {
          log.error("String_Node_Str",e);
        }
      }
    }
  }
}
Program: 32054
Project: 32054
Buggy source:
private boolean isHadoop2(){
  @SuppressWarnings("String_Node_Str") Class<?> mapContextImplClazz=null;
  try {
    mapContextImplClazz=Class.forName("String_Node_Str");
    return true;
  }
 catch (  ClassNotFoundException e) {
    return false;
  }
}

Fixed version (ground truth):
private boolean isHadoop2(){
  try {
    Class.forName("String_Node_Str");
    return true;
  }
 catch (  ClassNotFoundException e) {
    return false;
  }
}
Program: 32055
Project: 32055
Buggy source:
/** 
 * Return first line split string array. This is used to detect data schema.
 */
public static String[] takeFirstLine(String dataSetRawPath,String headerDelimiter,SourceType source) throws IOException {
  if (dataSetRawPath == null || headerDelimiter == null || source == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String firstValidFile=null;
  if (ShifuFileUtils.isDir(dataSetRawPath,source)) {
    FileSystem fs=ShifuFileUtils.getFileSystemBySourceType(source);
    FileStatus[] globStatus=fs.globStatus(new Path(dataSetRawPath),HIDDEN_FILE_FILTER);
    if (globStatus == null || globStatus.length == 0) {
      throw new IllegalArgumentException("String_Node_Str" + dataSetRawPath);
    }
 else {
      FileStatus[] listStatus=fs.listStatus(globStatus[0].getPath(),HIDDEN_FILE_FILTER);
      if (listStatus == null || listStatus.length == 0) {
        throw new IllegalArgumentException("String_Node_Str" + globStatus[0].getPath());
      }
      firstValidFile=listStatus[0].getPath().toString();
    }
  }
 else {
    firstValidFile=dataSetRawPath;
  }
  BufferedReader reader=null;
  try {
    reader=ShifuFileUtils.getReader(firstValidFile,source);
    String firstLine=reader.readLine();
    List<String> list=new ArrayList<String>();
    for (    String unit : Splitter.on(headerDelimiter).split(firstLine)) {
      list.add(unit);
    }
    return list.toArray(new String[0]);
  }
  finally {
    IOUtils.closeQuietly(reader);
  }
}

Fixed version (ground truth):
/** 
 * Return first line split string array. This is used to detect data schema.
 */
public static String[] takeFirstLine(String dataSetRawPath,String headerDelimiter,SourceType source) throws IOException {
  if (dataSetRawPath == null || headerDelimiter == null || source == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String firstValidFile=null;
  if (ShifuFileUtils.isDir(dataSetRawPath,source)) {
    FileSystem fs=ShifuFileUtils.getFileSystemBySourceType(source);
    FileStatus[] globStatus=fs.globStatus(new Path(dataSetRawPath),HIDDEN_FILE_FILTER);
    if (globStatus == null || globStatus.length == 0) {
      throw new IllegalArgumentException("String_Node_Str" + dataSetRawPath);
    }
 else {
      FileStatus[] listStatus=fs.listStatus(globStatus[0].getPath(),HIDDEN_FILE_FILTER);
      if (listStatus == null || listStatus.length == 0) {
        throw new IllegalArgumentException("String_Node_Str" + globStatus[0].getPath());
      }
      firstValidFile=listStatus[0].getPath().toString();
    }
  }
 else {
    firstValidFile=dataSetRawPath;
  }
  BufferedReader reader=null;
  try {
    reader=ShifuFileUtils.getReader(firstValidFile,source);
    String firstLine=reader.readLine();
    if (firstLine != null && firstLine.length() > 0) {
      List<String> list=new ArrayList<String>();
      for (      String unit : Splitter.on(headerDelimiter).split(firstLine)) {
        list.add(unit);
      }
      return list.toArray(new String[0]);
    }
  }
  finally {
    IOUtils.closeQuietly(reader);
  }
}
Program: 32058
Project: 32058
Buggy source:
@Override public final MLData compute(final MLData input){
  double[] data=input.getData();
  double predictSum=0d;
  double weightSum=0d;
  for (int i=0; i < this.trees.size(); i++) {
    TreeNode treeNode=this.trees.get(i);
    Double weight=this.weights.get(i);
    weightSum+=weight;
    predictSum+=predictNode(treeNode.getNode(),data) * weight;
  }
  double finalPredict=predictSum / weightSum;
  MLData result=new BasicMLData(1);
  result.setData(0,finalPredict);
  return result;
}

Fixed version (ground truth):
@Override public final MLData compute(final MLData input){
  double[] data=input.getData();
  double predictSum=0d;
  double weightSum=0d;
  for (int i=0; i < this.trees.size(); i++) {
    TreeNode treeNode=this.trees.get(i);
    Double weight=this.weights.get(i);
    weightSum+=weight;
    predictSum+=predictNode(treeNode.getNode(),data) * weight;
  }
  double finalPredict;
  if (this.isGBDT) {
    finalPredict=predictSum;
  }
 else {
    finalPredict=predictSum / weightSum;
  }
  MLData result=new BasicMLData(1);
  result.setData(0,finalPredict);
  return result;
}
Program: 32059
Project: 32059
Buggy source:
public static TreeModel loadFromStream(InputStream input,ModelConfig modelConfig,List<ColumnConfig> columnConfigList) throws IOException {
  DataInputStream dis=new DataInputStream(input);
  int treeNum=dis.readInt();
  List<TreeNode> trees=new ArrayList<TreeNode>(treeNum);
  String algorithm=modelConfig.getAlgorithm();
  List<Double> weights=new ArrayList<Double>(treeNum);
  for (int i=0; i < treeNum; i++) {
    TreeNode treeNode=new TreeNode();
    treeNode.readFields(dis);
    double learningRate=Double.valueOf(modelConfig.getParams().get(NNTrainer.LEARNING_RATE).toString());
    trees.add(treeNode);
    if (CommonConstants.RF_ALG_NAME.equalsIgnoreCase(algorithm)) {
      weights.add(1d);
    }
    if (CommonConstants.GBDT_ALG_NAME.equalsIgnoreCase(algorithm)) {
      if (i == 0) {
        weights.add(1d);
      }
 else {
        weights.add(learningRate);
      }
    }
  }
  return new TreeModel(trees,weights,CommonConstants.GBDT_ALG_NAME.equalsIgnoreCase(algorithm),columnConfigList);
}

Fixed version (ground truth):
public static TreeModel loadFromStream(InputStream input,ModelConfig modelConfig,List<ColumnConfig> columnConfigList) throws IOException {
  DataInputStream dis=new DataInputStream(input);
  int treeNum=dis.readInt();
  List<TreeNode> trees=new ArrayList<TreeNode>(treeNum);
  String algorithm=modelConfig.getAlgorithm();
  List<Double> weights=new ArrayList<Double>(treeNum);
  for (int i=0; i < treeNum; i++) {
    TreeNode treeNode=new TreeNode();
    treeNode.readFields(dis);
    double learningRate=Double.valueOf(modelConfig.getParams().get(NNTrainer.LEARNING_RATE).toString());
    trees.add(treeNode);
    if (CommonConstants.RF_ALG_NAME.equalsIgnoreCase(algorithm)) {
      weights.add(1d);
    }
    if (CommonConstants.GBDT_ALG_NAME.equalsIgnoreCase(algorithm)) {
      if (i == 0) {
        weights.add(1d);
      }
 else {
        weights.add(learningRate);
      }
    }
  }
  Map<Integer,Integer> columnMapping=new HashMap<Integer,Integer>(columnConfigList.size(),1f);
  int[] inputOutputIndex=DTrainUtils.getNumericAndCategoricalInputAndOutputCounts(columnConfigList);
  boolean isAfterVarSelect=inputOutputIndex[3] == 1 ? true : false;
  int index=0;
  for (int i=0; i < columnConfigList.size(); i++) {
    ColumnConfig columnConfig=columnConfigList.get(i);
    if (!isAfterVarSelect) {
      if (!columnConfig.isMeta() && !columnConfig.isTarget() && CommonUtils.isGoodCandidate(columnConfig)) {
        columnMapping.put(columnConfig.getColumnNum(),index);
        index+=1;
      }
    }
 else {
      if (columnConfig != null && !columnConfig.isMeta() && !columnConfig.isTarget() && columnConfig.isFinalSelect()) {
        columnMapping.put(columnConfig.getColumnNum(),index);
        index+=1;
      }
    }
  }
  return new TreeModel(trees,weights,CommonConstants.GBDT_ALG_NAME.equalsIgnoreCase(algorithm),columnConfigList,columnMapping);
}
Program: 32065
Project: 32065
Buggy source:
/** 
 * Copy local file to HDFS. This is used to set as classpath by distributed cache.
 */
private static Path shipToHDFS(Configuration conf,String fileName) throws IOException {
  Path dst=new Path("String_Node_Str",fileName.substring(fileName.lastIndexOf(File.separator) + 1));
  FileSystem fs=dst.getFileSystem(conf);
  OutputStream os=null;
  InputStream is=null;
  try {
    is=FileSystem.getLocal(conf).open(new Path(fileName));
    os=fs.create(dst);
    IOUtils.copyBytes(is,os,4096,true);
  }
  finally {
    org.apache.commons.io.IOUtils.closeQuietly(is);
    if (os != null) {
      os.close();
    }
  }
  return dst;
}

Fixed version (ground truth):
/** 
 * Copy local file to HDFS. This is used to set as classpath by distributed cache.
 */
private static Path shipToHDFS(Configuration conf,String fileName) throws IOException {
  Path dst=new Path(File.separator + "String_Node_Str" + File.separator+ System.getProperty("String_Node_Str")+ "String_Node_Str"+ System.currentTimeMillis(),fileName.substring(fileName.lastIndexOf(File.separator) + 1));
  FileSystem fs=dst.getFileSystem(conf);
  OutputStream os=null;
  InputStream is=null;
  try {
    is=FileSystem.getLocal(conf).open(new Path(fileName));
    os=fs.create(dst);
    IOUtils.copyBytes(is,os,4096,true);
  }
  finally {
    org.apache.commons.io.IOUtils.closeQuietly(is);
    if (os != null) {
      os.close();
    }
  }
  return dst;
}
Program: 32067
Project: 32067
Buggy source:
@Override public void readFields(DataInput in) throws IOException {
  int len=in.readInt();
  hyperBytes=new byte[len];
  in.readFully(hyperBytes);
  len=in.readInt();
  frequetItems=new HashSet<String>(len);
  for (int i=0; i < len; i++) {
    int unitLen=in.readInt();
    byte[] bytes=new byte[unitLen];
    in.readFully(bytes);
    frequetItems.add(new String(bytes,Constants.DEFAULT_CHARSET));
  }
}

Fixed version (ground truth):
@Override public void readFields(DataInput in) throws IOException {
  int len=in.readInt();
  hyperBytes=new byte[len];
  if (len != 0) {
    for (int i=0; i < len; i++) {
      hyperBytes[i]=in.readByte();
    }
  }
  len=in.readInt();
  frequetItems=new HashSet<String>(len,1f);
  if (len != 0) {
    for (int i=0; i < len; i++) {
      if (in.readBoolean()) {
        frequetItems.add(in.readUTF());
      }
    }
  }
}
Program: 32068
Project: 32068
Buggy source:
@Override public void write(DataOutput out) throws IOException {
  out.writeInt(hyperBytes.length);
  out.write(hyperBytes,0,hyperBytes.length);
  int setSize=Math.min(frequetItems.size(),FREQUET_ITEM_MAX_SIZE);
  out.writeInt(setSize);
  Iterator<String> iter=frequetItems.iterator();
  int i=0;
  while (i < setSize) {
    String unit=iter.next();
    out.writeInt(unit.length());
    byte[] bytes=unit.getBytes(Constants.DEFAULT_CHARSET);
    out.write(bytes,0,bytes.length);
    i++;
  }
}

Fixed version (ground truth):
@Override public void write(DataOutput out) throws IOException {
  if (hyperBytes == null) {
    out.writeInt(0);
  }
 else {
    out.writeInt(hyperBytes.length);
    for (int i=0; i < hyperBytes.length; i++) {
      out.writeByte(hyperBytes[i]);
    }
  }
  if (frequetItems == null) {
    out.writeInt(0);
  }
 else {
    int setSize=Math.min(frequetItems.size(),FREQUET_ITEM_MAX_SIZE);
    out.writeInt(setSize);
    Iterator<String> iter=frequetItems.iterator();
    int i=0;
    while (i < setSize) {
      String unit=iter.next();
      if (unit == null) {
        out.writeBoolean(false);
      }
 else {
        out.writeBoolean(true);
        out.writeUTF(unit);
      }
      i++;
    }
  }
}
Program: 32069
Project: 32069
Buggy source:
private int setCategoricalColumnsAndDistinctAccount(Map<Integer,Data> distinctCountMap,boolean cateOn,boolean distinctOn){
  int cateCount=0;
  for (  ColumnConfig columnConfig : columnConfigList) {
    Long distinctCount=distinctCountMap.get(columnConfig.getColumnNum()).count;
    if (distinctCount != null && modelConfig.getDataSet().getAutoTypeThreshold() != null) {
      if (cateOn) {
        if (distinctCount < modelConfig.getDataSet().getAutoTypeThreshold().longValue()) {
          String[] items=distinctCountMap.get(columnConfig.getColumnNum()).items;
          if (is01Variable(distinctCount,items)) {
            log.info("String_Node_Str",columnConfig.getColumnName(),columnConfig.getColumnNum(),distinctCount,Arrays.toString(items));
            columnConfig.setColumnType(ColumnType.N);
          }
 else           if (isDoubleFrequentVariable(distinctCount,items)) {
            log.info("String_Node_Str",columnConfig.getColumnName(),columnConfig.getColumnNum(),distinctCount,Arrays.toString(items));
            columnConfig.setColumnType(ColumnType.N);
          }
 else {
            columnConfig.setColumnType(ColumnType.C);
            cateCount+=1;
            log.info("String_Node_Str",columnConfig.getColumnName(),columnConfig.getColumnNum(),distinctCount,modelConfig.getDataSet().getAutoTypeThreshold());
          }
        }
      }
      if (distinctOn) {
        columnConfig.getColumnStats().setDistinctCount(distinctCount);
      }
    }
  }
  return cateCount;
}

Fixed version (ground truth):
private int setCategoricalColumnsAndDistinctAccount(Map<Integer,Data> distinctCountMap,boolean cateOn,boolean distinctOn){
  int cateCount=0;
  for (  ColumnConfig columnConfig : columnConfigList) {
    Data data=distinctCountMap.get(columnConfig.getColumnNum());
    if (data == null) {
      continue;
    }
    Long distinctCount=data.count;
    if (distinctCount != null && modelConfig.getDataSet().getAutoTypeThreshold() != null) {
      if (cateOn) {
        if (distinctCount < modelConfig.getDataSet().getAutoTypeThreshold().longValue()) {
          String[] items=data.items;
          if (is01Variable(distinctCount,items)) {
            log.info("String_Node_Str",columnConfig.getColumnName(),columnConfig.getColumnNum(),distinctCount,Arrays.toString(items));
            columnConfig.setColumnType(ColumnType.N);
          }
 else           if (isDoubleFrequentVariable(distinctCount,items)) {
            log.info("String_Node_Str",columnConfig.getColumnName(),columnConfig.getColumnNum(),distinctCount,Arrays.toString(items));
            columnConfig.setColumnType(ColumnType.N);
          }
 else {
            columnConfig.setColumnType(ColumnType.C);
            cateCount+=1;
            log.info("String_Node_Str",columnConfig.getColumnName(),columnConfig.getColumnNum(),distinctCount,modelConfig.getDataSet().getAutoTypeThreshold());
          }
        }
      }
      if (distinctOn) {
        columnConfig.getColumnStats().setDistinctCount(distinctCount);
      }
    }
  }
  return cateCount;
}
Program: 32070
Project: 32070
Buggy source:
/** 
 * To do some auto variable selection like remove ID-like variables, remove variable with high missing rate.
 */
private void autoVarSelCondition(){
  for (  ColumnConfig config : columnConfigList) {
    if (isIDLikeVariable(config)) {
      log.warn("String_Node_Str",config.getColumnName());
      config.setFinalSelect(false);
      continue;
    }
    if (isHighMissingRateColumn(config)) {
      log.warn("String_Node_Str",config.getColumnName());
      config.setFinalSelect(false);
      continue;
    }
    if (config.getIv() == null || config.getIv() <= BAD_IV_THRESHOLD) {
      log.warn("String_Node_Str",config.getColumnName(),BAD_IV_THRESHOLD);
      config.setFinalSelect(false);
      continue;
    }
  }
}

Fixed version (ground truth):
/** 
 * To do some auto variable selection like remove ID-like variables, remove variable with high missing rate.
 */
private void autoVarSelCondition(){
  for (  ColumnConfig config : columnConfigList) {
    if (isIDLikeVariable(config) && !config.isForceSelect()) {
      log.warn("String_Node_Str",config.getColumnName());
      config.setFinalSelect(false);
      continue;
    }
    if (isHighMissingRateColumn(config) && !config.isForceSelect()) {
      log.warn("String_Node_Str",config.getColumnName());
      config.setFinalSelect(false);
      continue;
    }
    if ((config.getIv() == null || config.getIv() <= BAD_IV_THRESHOLD) && !config.isForceSelect()) {
      log.warn("String_Node_Str",config.getColumnName(),BAD_IV_THRESHOLD);
      config.setFinalSelect(false);
      continue;
    }
  }
}
Program: 32073
Project: 32073
Buggy source:
@Override public void doWrite(DataOutput out) throws IOException {
  if (parameters != null) {
    out.writeInt(this.parameters.length);
    for (int i=0; i < this.parameters.length; i++) {
      out.writeDouble(this.parameters[i]);
    }
  }
  out.writeDouble(this.trainError);
  out.writeDouble(this.testError);
  out.writeLong(this.trainSize);
  out.writeLong(this.testSize);
}

Fixed version (ground truth):
@Override public void doWrite(DataOutput out) throws IOException {
  if (parameters == null) {
    out.writeInt(0);
  }
 else {
    out.writeInt(this.parameters.length);
    for (int i=0; i < this.parameters.length; i++) {
      out.writeDouble(this.parameters[i]);
    }
  }
  out.writeDouble(this.trainError);
  out.writeDouble(this.testError);
  out.writeLong(this.trainSize);
  out.writeLong(this.testSize);
}
Program: 32075
Project: 32075
Buggy source:
private InternalEntropyInfo getEntropyInterInfo(double[] statsByClasses){
  double sumAll=0;
  for (int i=0; i < statsByClasses.length; i++) {
    sumAll+=statsByClasses[i];
  }
  double impurity=0d;
  int indexOfLargestElement=0;
  double maxElement=Double.MIN_VALUE;
  for (int i=0; i < statsByClasses.length; i++) {
    double rate=statsByClasses[i] / sumAll;
    impurity-=rate * rate;
    if (statsByClasses[i] > maxElement) {
      maxElement=statsByClasses[i];
      indexOfLargestElement=i;
    }
  }
  return new InternalEntropyInfo(sumAll,indexOfLargestElement,impurity);
}

Fixed version (ground truth):
private InternalEntropyInfo getEntropyInterInfo(double[] statsByClasses){
  double sumAll=0;
  for (int i=0; i < statsByClasses.length; i++) {
    sumAll+=statsByClasses[i];
  }
  double impurity=0d;
  int indexOfLargestElement=-1;
  if (sumAll != 0d) {
    double maxElement=Double.MIN_VALUE;
    for (int i=0; i < statsByClasses.length; i++) {
      double rate=statsByClasses[i] / sumAll;
      impurity-=rate * rate;
      if (statsByClasses[i] > maxElement) {
        maxElement=statsByClasses[i];
        indexOfLargestElement=i;
      }
    }
  }
  return new InternalEntropyInfo(sumAll,indexOfLargestElement,impurity);
}
Program: 32077
Project: 32077
Buggy source:
@Override protected void map(LongWritable key,Text value,Context context) throws IOException, InterruptedException {
  String valueStr=value.toString();
  if (!this.dataPurifier.isFilterOut(valueStr)) {
    return;
  }
  if (valueStr == null || valueStr.length() == 0 || valueStr.trim().length() == 0) {
    LOG.warn("String_Node_Str");
    return;
  }
  String[] units=CommonUtils.split(valueStr,this.modelConfig.getDataSetDelimiter());
  String tag=units[this.tagColumnNum];
  if (!this.tags.contains(tag)) {
    if (System.currentTimeMillis() % 20 == 0) {
      LOG.warn("String_Node_Str",tag);
    }
    return;
  }
  int i=0;
  for (  String unit : units) {
    if (unit == null || this.modelConfig.getDataSet().getMissingOrInvalidValues().contains(unit.toLowerCase())) {
      i++;
      continue;
    }
    CountAndFrequentItems countAndFrequentItems=this.variableCountMap.get(i);
    if (countAndFrequentItems == null) {
      countAndFrequentItems=new CountAndFrequentItems();
      this.variableCountMap.put(i,countAndFrequentItems);
    }
    countAndFrequentItems.offer(unit);
    i++;
  }
}

Fixed version (ground truth):
@Override protected void map(LongWritable key,Text value,Context context) throws IOException, InterruptedException {
  String valueStr=value.toString();
  if (valueStr == null || valueStr.length() == 0 || valueStr.trim().length() == 0) {
    LOG.warn("String_Node_Str");
    return;
  }
  if (!this.dataPurifier.isFilterOut(valueStr)) {
    return;
  }
  String[] units=CommonUtils.split(valueStr,this.modelConfig.getDataSetDelimiter());
  String tag=units[this.tagColumnNum];
  if (!this.tags.contains(tag)) {
    if (System.currentTimeMillis() % 20 == 0) {
      LOG.warn("String_Node_Str",tag);
    }
    return;
  }
  int i=0;
  for (  String unit : units) {
    if (unit == null || this.modelConfig.getDataSet().getMissingOrInvalidValues().contains(unit.toLowerCase())) {
      i++;
      continue;
    }
    CountAndFrequentItems countAndFrequentItems=this.variableCountMap.get(i);
    if (countAndFrequentItems == null) {
      countAndFrequentItems=new CountAndFrequentItems();
      this.variableCountMap.put(i,countAndFrequentItems);
    }
    countAndFrequentItems.offer(unit);
    i++;
  }
}
Program: 32079
Project: 32079
Buggy source:
@Override public void readFields(DataInput in) throws IOException {
  int len=in.readInt();
  hyperBytes=new byte[len];
  in.readFully(hyperBytes);
  len=in.readInt();
  frequetItems=new HashSet<String>(len);
  for (int i=0; i < len; i++) {
    int unitLen=in.readInt();
    byte[] bytes=new byte[unitLen];
    in.readFully(bytes);
    frequetItems.add(new String(bytes,Constants.UTF8_CHARSET));
  }
}

Fixed version (ground truth):
@Override public void readFields(DataInput in) throws IOException {
  int len=in.readInt();
  hyperBytes=new byte[len];
  in.readFully(hyperBytes);
  len=in.readInt();
  frequetItems=new HashSet<String>(len);
  for (int i=0; i < len; i++) {
    int unitLen=in.readInt();
    byte[] bytes=new byte[unitLen];
    in.readFully(bytes);
    frequetItems.add(new String(bytes,Constants.DEFAULT_CHARSET));
  }
}
Program: 32080
Project: 32080
Buggy source:
@Override public void write(DataOutput out) throws IOException {
  out.writeInt(hyperBytes.length);
  out.write(hyperBytes,0,hyperBytes.length);
  int setSize=Math.min(frequetItems.size(),FREQUET_ITEM_MAX_SIZE);
  out.writeInt(setSize);
  Iterator<String> iter=frequetItems.iterator();
  int i=0;
  while (i < setSize) {
    String unit=iter.next();
    out.writeInt(unit.length());
    byte[] bytes=unit.getBytes(Constants.UTF8_CHARSET);
    out.write(bytes,0,bytes.length);
    i++;
  }
}

Fixed version (ground truth):
@Override public void write(DataOutput out) throws IOException {
  out.writeInt(hyperBytes.length);
  out.write(hyperBytes,0,hyperBytes.length);
  int setSize=Math.min(frequetItems.size(),FREQUET_ITEM_MAX_SIZE);
  out.writeInt(setSize);
  Iterator<String> iter=frequetItems.iterator();
  int i=0;
  while (i < setSize) {
    String unit=iter.next();
    out.writeInt(unit.length());
    byte[] bytes=unit.getBytes(Constants.DEFAULT_CHARSET);
    out.write(bytes,0,bytes.length);
    i++;
  }
}
Program: 32081
Project: 32081
Buggy source:
@JsonIgnore public List<String> getTags(){
  List<String> tags=new ArrayList<String>();
  if (CollectionUtils.isNotEmpty(dataSet.getPosTags())) {
    for (    String tag : dataSet.getPosTags()) {
      tags.add(tag);
    }
  }
  if (CollectionUtils.isNotEmpty(dataSet.getNegTags())) {
    for (    String tag : dataSet.getNegTags()) {
      tags.add(tag);
    }
  }
  return tags;
}

Fixed version (ground truth):
@JsonIgnore public List<String> getTags(){
  return getTags(dataSet.getPosTags(),dataSet.getNegTags());
}
Program: 32082
Project: 32082
Buggy source:
/** 
 * Flattened tags for multiple classification. '1', '2|3' will be flattened to '1', '2', '3'. While '2' and '3' are combined to one class.
 */
@JsonIgnore public List<String> getFlattenTags(){
  List<String> tags=new ArrayList<String>();
  if (CollectionUtils.isNotEmpty(dataSet.getPosTags())) {
    for (    String tag : dataSet.getPosTags()) {
      if (tag.contains("String_Node_Str")) {
        for (        String inTag : tag.split("String_Node_Str")) {
          if (StringUtils.isNotBlank(inTag)) {
            tags.add(inTag);
          }
        }
      }
 else {
        tags.add(tag);
      }
    }
  }
  if (CollectionUtils.isNotEmpty(dataSet.getNegTags())) {
    for (    String tag : dataSet.getNegTags()) {
      if (tag.contains("String_Node_Str")) {
        for (        String inTag : tag.split("String_Node_Str")) {
          if (StringUtils.isNotBlank(inTag)) {
            tags.add(inTag);
          }
        }
      }
 else {
        tags.add(tag);
      }
    }
  }
  return tags;
}

Fixed version (ground truth):
@JsonIgnore public List<String> getFlattenTags(List<String> tags1,List<String> tags2){
  List<String> tags=new ArrayList<String>();
  if (CollectionUtils.isNotEmpty(tags1)) {
    for (    String tag : tags1) {
      if (tag.contains("String_Node_Str")) {
        for (        String inTag : tag.split("String_Node_Str")) {
          if (StringUtils.isNotBlank(inTag)) {
            tags.add(inTag);
          }
        }
      }
 else {
        tags.add(tag);
      }
    }
  }
  if (CollectionUtils.isNotEmpty(tags2)) {
    for (    String tag : tags2) {
      if (tag.contains("String_Node_Str")) {
        for (        String inTag : tag.split("String_Node_Str")) {
          if (StringUtils.isNotBlank(inTag)) {
            tags.add(inTag);
          }
        }
      }
 else {
        tags.add(tag);
      }
    }
  }
  return tags;
}
Program: 32083
Project: 32083
Buggy source:
@JsonIgnore public List<Set<String>> getSetTags(){
  List<String> tags=getTags();
  List<Set<String>> result=new ArrayList<Set<String>>();
  for (  String tag : tags) {
    Set<String> set=new HashSet<String>(16);
    if (tag.contains("String_Node_Str")) {
      for (      String inTag : tag.split("String_Node_Str")) {
        if (StringUtils.isNotBlank(inTag)) {
          set.add(inTag);
        }
      }
    }
 else {
      set.add(tag);
    }
    result.add(set);
  }
  return result;
}

Fixed version (ground truth):
@JsonIgnore public List<Set<String>> getSetTags(){
  return getSetTags(dataSet.getPosTags(),dataSet.getNegTags());
}
Program: 32086
Project: 32086
Buggy source:
private static String limitedFrequentItems(Set<String> fis){
  StringBuilder sb=new StringBuilder(200);
  int size=Math.min(fis.size(),CountAndFrequentItemsWritable.FREQUET_ITEM_MAX_SIZE);
  Iterator<String> iterator=fis.iterator();
  int i=0;
  while (i < size) {
    String next=iterator.next().replaceAll("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
    sb.append(next);
    if (i != size - 1) {
      sb.append("String_Node_Str");
    }
    i+=1;
  }
  return sb.toString();
}

Fixed version (ground truth):
private static String limitedFrequentItems(Set<String> fis){
  StringBuilder sb=new StringBuilder(200);
  int size=Math.min(fis.size(),CountAndFrequentItemsWritable.FREQUET_ITEM_MAX_SIZE * 10);
  Iterator<String> iterator=fis.iterator();
  int i=0;
  while (i < size) {
    String next=iterator.next().replaceAll("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
    sb.append(next);
    if (i != size - 1) {
      sb.append("String_Node_Str");
    }
    i+=1;
  }
  return sb.toString();
}
Program: 32088
Project: 32088
Buggy source:
@Override public void initialize(GuaguaFileSplit split) throws IOException {
  ReadSupport<Tuple> readSupport=getReadSupportInstance(this.conf);
  this.parquetRecordReader=new ParquetRecordReader<Tuple>(readSupport,getFilter(this.conf));
  ParquetInputSplit parquetInputSplit=new ParquetInputSplit(new Path(split.getPath()),split.getOffset(),split.getOffset() + split.getLength(),split.getLength(),null,null);
  try {
    this.parquetRecordReader.initialize(parquetInputSplit,new TaskAttemptContextImpl(this.conf,new TaskAttemptID("String_Node_Str",-1,TaskType.MAP,-1,-1)));
  }
 catch (  InterruptedException e) {
    throw new GuaguaRuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void initialize(GuaguaFileSplit split) throws IOException {
  ReadSupport<Tuple> readSupport=getReadSupportInstance(this.conf);
  this.parquetRecordReader=new ParquetRecordReader<Tuple>(readSupport,getFilter(this.conf));
  ParquetInputSplit parquetInputSplit=new ParquetInputSplit(new Path(split.getPath()),split.getOffset(),split.getOffset() + split.getLength(),split.getLength(),null,null);
  try {
    this.parquetRecordReader.initialize(parquetInputSplit,buildContext());
  }
 catch (  InterruptedException e) {
    throw new GuaguaRuntimeException(e);
  }
}
Program: 32089
Project: 32089
Buggy source:
@Override public LogisticRegressionParams compute(MasterContext<LogisticRegressionParams,LogisticRegressionParams> context){
  if (context.isFirstIteration()) {
    init(context);
    weights=new double[this.inputNum];
    for (int i=0; i < weights.length; i++) {
      weights[i]=nextDouble(-1,1);
    }
    return new LogisticRegressionParams(weights);
  }
 else {
    double[] gradients=new double[this.inputNum];
    double trainError=0.0d, testError=0d;
    long trainSize=0, testSize=0;
    for (    LogisticRegressionParams param : context.getWorkerResults()) {
      if (param != null) {
        for (int i=0; i < gradients.length; i++) {
          gradients[i]+=param.getParameters()[i];
        }
        trainError+=param.getTrainError();
        testError+=param.getTestError();
        trainSize+=param.getTrainSize();
        testSize+=param.getTestSize();
      }
    }
    for (int i=0; i < weights.length; i++) {
      weights[i]-=learningRate * ((gradients[i] + this.regularizedConstant * weights[i]) / trainSize);
    }
    double reg=this.regularizedParameter(this.regularizedConstant,trainSize);
    LOG.debug("String_Node_Str",Arrays.toString(this.weights));
    double finalTrainError=trainError / trainSize + reg;
    double finalTestError=testError / testSize + reg;
    LOG.info("String_Node_Str",context.getCurrentIteration(),finalTrainError,finalTestError);
    return new LogisticRegressionParams(weights,finalTrainError,finalTestError,trainSize,testSize);
  }
}

Fixed version (ground truth):
@Override public LogisticRegressionParams compute(MasterContext<LogisticRegressionParams,LogisticRegressionParams> context){
  if (context.isFirstIteration()) {
    init(context);
    weights=new double[this.inputNum + 1];
    for (int i=0; i < weights.length; i++) {
      weights[i]=nextDouble(-1,1);
    }
    return new LogisticRegressionParams(weights);
  }
 else {
    double[] gradients=new double[this.inputNum + 1];
    double trainError=0.0d, testError=0d;
    long trainSize=0, testSize=0;
    for (    LogisticRegressionParams param : context.getWorkerResults()) {
      if (param != null) {
        for (int i=0; i < gradients.length; i++) {
          gradients[i]+=param.getParameters()[i];
        }
        trainError+=param.getTrainError();
        testError+=param.getTestError();
        trainSize+=param.getTrainSize();
        testSize+=param.getTestSize();
      }
    }
    if (this.weightCalculator == null) {
      this.weightCalculator=new Weight(weights.length,trainSize,learningRate,"String_Node_Str");
    }
    this.weights=this.weightCalculator.calculateWeights(this.weights,gradients);
    double reg=this.regularizedParameter(this.regularizedConstant,trainSize);
    LOG.debug("String_Node_Str",Arrays.toString(this.weights));
    double finalTrainError=trainError / trainSize + reg;
    double finalTestError=testError / testSize + reg;
    LOG.info("String_Node_Str",context.getCurrentIteration(),finalTrainError,finalTestError);
    return new LogisticRegressionParams(weights,finalTrainError,finalTestError,trainSize,testSize);
  }
}
Program: 32090
Project: 32090
Buggy source:
public final double nextDouble(final double min,final double max){
  final double range=max - min;
  return (range * RANDOM.nextDouble()) + min;
}

Fixed version (ground truth):
public final double nextDouble(final double min,final double max){
  final double range=max - min;
  return (range * Math.random()) + min;
}
Program: 32092
Project: 32092
Buggy source:
/** 
 * Compute sigmoid value by dot operation of two vectors.
 */
private double sigmoid(double[] inputs,double[] weights){
  double value=0.0d;
  for (int i=0; i < weights.length; i++) {
    value+=weights[i] * inputs[i];
  }
  return 1.0d / (1.0d + BoundMath.exp(-1 * value));
}

Fixed version (ground truth):
/** 
 * Compute sigmoid value by dot operation of two vectors.
 */
private double sigmoid(double[] inputs,double[] weights){
  double value=0.0d;
  for (int i=0; i < inputs.length; i++) {
    value+=weights[i] * inputs[i];
  }
  value+=weights[inputs.length] * 1d;
  return 1.0d / (1.0d + BoundMath.exp(-1 * value));
}
Program: 32093
Project: 32093
Buggy source:
@Override protected void postLoad(WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context){
  this.trainingData.switchState();
  this.testingData.switchState();
}

Fixed version (ground truth):
@Override protected void postLoad(WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context){
  this.trainingData.switchState();
  this.testingData.switchState();
  LOG.info("String_Node_Str",this.count);
  LOG.info("String_Node_Str",this.modelConfig.getBaggingSampleRate());
  LOG.info("String_Node_Str",this.modelConfig.isBaggingWithReplacement());
  LOG.info("String_Node_Str",this.modelConfig.getCrossValidationRate());
  LOG.info("String_Node_Str",this.trainingData.size());
  LOG.info("String_Node_Str",this.testingData.size());
}
Program: 32094
Project: 32094
Buggy source:
public Weight(int numWeight,double numTrainSize,double rate,String algorithm){
  this.lastDelta=new double[numWeight];
  this.lastGradient=new double[numWeight];
  this.eps=this.outputEpsilon / numTrainSize;
  this.shrink=rate / (1.0 + rate);
  this.setLearningRate(rate);
  this.algorithm=algorithm;
  this.updateValues=new double[numWeight];
  for (int i=0; i < this.updateValues.length; i++) {
    this.updateValues[i]=DEFAULT_INITIAL_UPDATE;
    this.lastDelta[i]=0;
  }
}

Fixed version (ground truth):
public Weight(int numWeight,double numTrainSize,double rate,String algorithm){
  this.lastDelta=new double[numWeight];
  this.lastGradient=new double[numWeight];
  this.eps=this.outputEpsilon / numTrainSize;
  this.shrink=rate / (1.0 + rate);
  this.learningRate=rate;
  this.algorithm=algorithm;
  this.updateValues=new double[numWeight];
  for (int i=0; i < this.updateValues.length; i++) {
    this.updateValues[i]=DEFAULT_INITIAL_UPDATE;
    this.lastDelta[i]=0;
  }
}
Program: 32095
Project: 32095
Buggy source:
@Override public NNParams doCompute(WorkerContext<NNParams,NNParams> workerContext){
  if (this.isDry || workerContext.isFirstIteration()) {
    return buildEmptyNNParams(workerContext);
  }
  if (workerContext.getLastMasterResult() == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  LOG.debug("String_Node_Str",workerContext.getLastMasterResult());
  if (gradient == null) {
    initGradient(this.trainingData,this.testingData,workerContext.getLastMasterResult().getWeights(),this.isCrossOver);
  }
  if (this.isCrossOver) {
    this.gradient.setSeed(System.currentTimeMillis());
  }
  this.gradient.setWeights(workerContext.getLastMasterResult().getWeights());
  for (int i=0; i < epochsPerIteration; i++) {
    this.gradient.run();
    this.gradient.setWeights(this.gradient.getWeights());
  }
  double trainError=this.gradient.getError();
  double testError=this.testingData.getRecordCount() > 0 ? (this.gradient.calculateError()) : this.gradient.getError();
  LOG.info("String_Node_Str",new Object[]{workerContext.getCurrentIteration(),trainError,(this.testingData.getRecordCount() > 0 ? testError : "String_Node_Str")});
  NNParams params=new NNParams();
  params.setTestError(testError);
  params.setTrainError(trainError);
  params.setGradients(this.gradient.getGradients());
  params.setWeights(new double[0]);
  params.setTrainSize(this.trainingData.getRecordCount());
  return params;
}

Fixed version (ground truth):
@Override public NNParams doCompute(WorkerContext<NNParams,NNParams> workerContext){
  if (this.isDry || workerContext.isFirstIteration()) {
    return buildEmptyNNParams(workerContext);
  }
  if (workerContext.getLastMasterResult() == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  LOG.debug("String_Node_Str",workerContext.getLastMasterResult());
  double[] weights=workerContext.getLastMasterResult().getWeights();
  if (gradient == null) {
    initGradient(this.trainingData,this.testingData,weights,this.isCrossOver);
  }
  if (this.isCrossOver) {
    this.gradient.setSeed(System.currentTimeMillis());
  }
  this.gradient.setWeights(weights);
  for (int i=0; i < epochsPerIteration; i++) {
    this.gradient.run();
    this.gradient.setWeights(this.gradient.getWeights());
  }
  double trainError=this.gradient.getError();
  double testError=this.testingData.getRecordCount() > 0 ? (this.gradient.calculateError()) : this.gradient.getError();
  LOG.info("String_Node_Str",new Object[]{workerContext.getCurrentIteration(),trainError,(this.testingData.getRecordCount() > 0 ? testError : "String_Node_Str")});
  NNParams params=new NNParams();
  params.setTestError(testError);
  params.setTrainError(trainError);
  params.setGradients(this.gradient.getGradients());
  params.setWeights(new double[0]);
  params.setTrainSize(this.trainingData.getRecordCount());
  return params;
}
Program: 32096
Project: 32096
Buggy source:
@SuppressWarnings({"String_Node_Str"}) private NNParams initWeights(){
  NNParams params=new NNParams();
  int[] inputAndOutput=NNUtils.getInputOutputCandidateCounts(this.columnConfigList);
  int inputNodeCount=inputAndOutput[0] == 0 ? inputAndOutput[2] : inputAndOutput[0];
  int outputNodeCount=inputAndOutput[1];
  int numLayers=(Integer)this.modelConfig.getParams().get(NNTrainer.NUM_HIDDEN_LAYERS);
  List<String> actFunc=(List<String>)this.modelConfig.getParams().get(NNTrainer.ACTIVATION_FUNC);
  List<Integer> hiddenNodeList=(List<Integer>)this.modelConfig.getParams().get(NNTrainer.NUM_HIDDEN_NODES);
  BasicNetwork network=NNUtils.generateNetwork(inputNodeCount,outputNodeCount,numLayers,actFunc,hiddenNodeList);
  params.setTrainError(0);
  params.setTestError(0);
  params.setGradients(new double[0]);
  params.setWeights(network.getFlat().getWeights());
  return params;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) private NNParams initWeights(){
  NNParams params=new NNParams();
  int[] inputAndOutput=NNUtils.getInputOutputCandidateCounts(this.columnConfigList);
  int inputNodeCount=inputAndOutput[0] == 0 ? inputAndOutput[2] : inputAndOutput[0];
  int outputNodeCount=inputAndOutput[1];
  int numLayers=(Integer)this.modelConfig.getParams().get(NNTrainer.NUM_HIDDEN_LAYERS);
  List<String> actFunc=(List<String>)this.modelConfig.getParams().get(NNTrainer.ACTIVATION_FUNC);
  List<Integer> hiddenNodeList=(List<Integer>)this.modelConfig.getParams().get(NNTrainer.NUM_HIDDEN_NODES);
  LOG.info("String_Node_Str",inputNodeCount,outputNodeCount);
  BasicNetwork network=NNUtils.generateNetwork(inputNodeCount,outputNodeCount,numLayers,actFunc,hiddenNodeList);
  params.setTrainError(0);
  params.setTestError(0);
  params.setGradients(new double[0]);
  params.setWeights(network.getFlat().getWeights());
  return params;
}
Program: 32097
Project: 32097
Buggy source:
@Override public void initRecordReader(GuaguaFileSplit fileSplit) throws IOException {
  Configuration conf=new Configuration();
  String pigSchema=super.props.getProperty("String_Node_Str");
  LOG.info("String_Node_Str",pigSchema);
  conf.set("String_Node_Str",pigSchema);
  String requiredFieldList=super.props.getProperty("String_Node_Str");
  conf.set("String_Node_Str",requiredFieldList);
  LOG.info("String_Node_Str",requiredFieldList);
  String indexAccess=super.props.getProperty("String_Node_Str");
  conf.set("String_Node_Str",indexAccess);
  LOG.info("String_Node_Str",indexAccess);
  super.setRecordReader(new GuaguaParquetRecordReader(conf,fileSplit));
}

Fixed version (ground truth):
@Override public void initRecordReader(GuaguaFileSplit fileSplit) throws IOException {
  Configuration conf=new Configuration();
  String pigSchema=super.props.getProperty("String_Node_Str");
  LOG.debug("String_Node_Str",pigSchema);
  conf.set("String_Node_Str",pigSchema);
  String requiredFieldList=super.props.getProperty("String_Node_Str");
  conf.set("String_Node_Str",requiredFieldList);
  LOG.debug("String_Node_Str",requiredFieldList);
  String indexAccess=super.props.getProperty("String_Node_Str");
  conf.set("String_Node_Str",indexAccess);
  LOG.debug("String_Node_Str",indexAccess);
  super.setRecordReader(new GuaguaParquetRecordReader(conf,fileSplit));
}