nus-yam/ex-repair huggingface dataset:
Program: 130251
Project: 130251
Buggy source:
/** 
 * Gets the job client.
 * @param loader the loader
 * @return the job client
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static JobClient getJobClient(Loader loader) throws IOException {
  String jobTrackerURI=RemotingUtil.getHadoopConfigurationValue(loader,"String_Node_Str","String_Node_Str");
  JobClient client=null;
  Configuration config=new Configuration();
  YamlLoader yamlLoader=(YamlLoader)loader;
  YamlConfig yamlConfig=(YamlConfig)yamlLoader.getYamlConfiguration();
  config.set(yamlConfig.getMaster().getUser(),"String_Node_Str");
  if (Enable.TRUE.equals(yamlConfig.getEnableYarn())) {
    config.set("String_Node_Str","String_Node_Str");
  }
  try {
    if (StringUtil.emptyOrNull(jobTrackerURI)) {
      client=new JobClient(new InetSocketAddress("String_Node_Str",8032),config);
    }
 else {
      client=new JobClient(new InetSocketAddress(jobTrackerURI.split("String_Node_Str")[0],Integer.parseInt(jobTrackerURI.split("String_Node_Str")[1])),config);
    }
  }
 catch (  Exception e) {
    LOGGER.error(e);
  }
  return client;
}

Fixed version (ground truth):
/** 
 * Gets the job client.
 * @param loader the loader
 * @return the job client
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static JobClient getJobClient(Loader loader) throws IOException {
  String jobTrackerURI=RemotingUtil.getHadoopConfigurationValue(loader,"String_Node_Str","String_Node_Str");
  JobClient client=null;
  Configuration config=new Configuration();
  YamlLoader yamlLoader=(YamlLoader)loader;
  YamlConfig yamlConfig=(YamlConfig)yamlLoader.getYamlConfiguration();
  config.set(yamlConfig.getMaster().getUser(),"String_Node_Str");
  if (Enable.TRUE.equals(yamlConfig.getEnableYarn())) {
    config.set("String_Node_Str","String_Node_Str");
  }
  try {
    if (StringUtil.emptyOrNull(jobTrackerURI)) {
      LOGGER.debug("String_Node_Str");
      client=new JobClient(new InetSocketAddress("String_Node_Str",8032),config);
    }
 else {
      client=new JobClient(new InetSocketAddress(jobTrackerURI.split("String_Node_Str")[0],Integer.parseInt(jobTrackerURI.split("String_Node_Str")[1])),config);
    }
  }
 catch (  Exception e) {
    LOGGER.error(e);
  }
  return client;
}
Program: 130252
Project: 130252
Buggy source:
/** 
 * * This method retrieves out a Hadoop configuration parameters value. User has to specify appropriate Hadoop configuration file and configuration name. This method assumes that given configuration file is present in HADOOP_HOME/conf directory.
 * @param loader the loader
 * @param hadoopConfigurationFile configuration file in Hadoop configuration directory
 * @param configurationToGet Hadoop configuration parameter.
 * @return configuration value.
 */
public static String getHadoopConfigurationValue(Loader loader,String hadoopConfigurationFile,String configurationToGet){
  String destinationReceiveDir=copyAndGetHadoopConfigurationFilePath(loader,hadoopConfigurationFile);
  return parseConfiguration(destinationReceiveDir + "String_Node_Str" + hadoopConfigurationFile,configurationToGet);
}

Fixed version (ground truth):
/** 
 * * This method retrieves out a Hadoop configuration parameters value. User has to specify appropriate Hadoop configuration file and configuration name. This method assumes that given configuration file is present in HADOOP_HOME/conf directory.
 * @param loader the loader
 * @param hadoopConfigurationFile configuration file in Hadoop configuration directory
 * @param configurationToGet Hadoop configuration parameter.
 * @return configuration value.
 */
public static String getHadoopConfigurationValue(Loader loader,String hadoopConfigurationFile,String configurationToGet){
  String hadoopConfDir=RemotingUtil.getHadoopConfigurationDirPath(loader);
  String destinationReceiveDir=copyAndGetConfigurationFilePath(loader,hadoopConfDir,hadoopConfigurationFile);
  return parseConfiguration(destinationReceiveDir + "String_Node_Str" + hadoopConfigurationFile,configurationToGet);
}
Program: 130254
Project: 130254
Buggy source:
/** 
 * Check mr job field.
 * @param config object of yamlConfig class
 * @param failedCasesList error list
 */
protected void checkMrJobField(Config config){
  Map<String,String> failedCases=new HashMap<String,String>();
  Map<String,String> suggetion=new HashMap<String,String>();
  YamlConfig yamlConfig=(YamlConfig)config;
  if (isEnable(yamlConfig.getEnableStaticJobProfiling()) || yamlConfig.getDebugAnalysis().getEnumValue()) {
    checkNullEmptyAndMessage(failedCases,yamlConfig.getInputFile(),ErrorMessages.BASIC_INPUT_PATH_EMPTY,"String_Node_Str");
    validateJobs(config,failedCases,suggetion);
  }
  addToValidationList(Constants.JOBS_VALIDATION,failedCases,suggetion);
}

Fixed version (ground truth):
/** 
 * Check mr job field.
 * @param config object of yamlConfig class
 * @param failedCasesList error list
 */
protected void checkMrJobField(Config config){
  Map<String,String> failedCases=new HashMap<String,String>();
  Map<String,String> suggetion=new HashMap<String,String>();
  YamlConfig yamlConfig=(YamlConfig)config;
  if (!isEnable(yamlConfig.getEnableStaticJobProfiling()) || yamlConfig.getDebugAnalysis().getEnumValue()) {
    checkNullEmptyAndMessage(failedCases,yamlConfig.getInputFile(),ErrorMessages.BASIC_INPUT_PATH_EMPTY,"String_Node_Str");
    validateJobs(config,failedCases,suggetion);
  }
  addToValidationList(Constants.JOBS_VALIDATION,failedCases,suggetion);
}
Program: 130255
Project: 130255
Buggy source:
/** 
 * This method checks whether the jar location given corresponds to a valid jar file or not.
 * @param yamlConfig
 */
public void validateJarPath(YamlConfig yamlConfig){
  if (isEnable(yamlConfig.getDebugAnalysis()) || (isEnable(yamlConfig.getEnableStaticJobProfiling()) && isEnable(yamlConfig.getRunJobFromJumbune()))) {
    String inputFile=yamlConfig.getInputFile();
    Map<String,String> failedCases=new HashMap<String,String>();
    boolean isLocalSystemJar=isEnable(yamlConfig.getIsLocalSystemJar());
    if (inputFile != null) {
      boolean endsWithJar=inputFile.trim().endsWith("String_Node_Str");
      if ((((!endsWithJar || !new File(inputFile).exists()) && (!isLocalSystemJar)) || (isLocalSystemJar && !endsWithJar))) {
        failedCases.put(inputFile,errorMessages.get(ErrorMessages.SUPPLIED_JAR_INVALID));
        failedValidation.put("String_Node_Str",failedCases);
      }
    }
 else {
      failedCases.put(inputFile,errorMessages.get(ErrorMessages.SUPPLIED_JAR_INVALID));
      failedValidation.put("String_Node_Str",failedCases);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method checks whether the jar location given corresponds to a valid jar file or not.
 * @param yamlConfig
 */
public void validateJarPath(YamlConfig yamlConfig){
  if (isEnable(yamlConfig.getDebugAnalysis()) || (isEnable(yamlConfig.getEnableStaticJobProfiling()) && isEnable(yamlConfig.getRunJobFromJumbune()))) {
    String inputFile=yamlConfig.getInputFile();
    Map<String,String> failedCases=new HashMap<String,String>();
    boolean isLocalSystemJar=isEnable(yamlConfig.getIsLocalSystemJar());
    if (inputFile != null) {
      boolean endsWithJar=inputFile.trim().endsWith("String_Node_Str");
      if ((((!endsWithJar || !new File(inputFile).exists()) && (!isLocalSystemJar)) || (isLocalSystemJar && !endsWithJar))) {
        failedCases.put(inputFile,errorMessages.get(ErrorMessages.SUPPLIED_JAR_INVALID));
        failedValidation.put("String_Node_Str",failedCases);
      }
    }
 else {
      failedCases.put(inputFile,errorMessages.get(ErrorMessages.BASIC_INPUT_PATH_EMPTY));
      failedValidation.put("String_Node_Str",failedCases);
    }
  }
}
Program: 130256
Project: 130256
Buggy source:
@Override public String getHadoopConfDirPath(YamlConfig config){
  StringBuilder responseAppender=new StringBuilder();
  String response=RemotingUtil.executeCommand(config,ECHO_HADOOP_CONF_DIR);
  LOGGER.info("String_Node_Str" + response);
  if (response != null || !response.isEmpty()) {
    return response;
  }
  responseAppender=responseAppender.append(getHadoopHomeDirPath(config)).append(File.separator).append(CONF_DIR);
  return responseAppender.toString();
}

Fixed version (ground truth):
@Override public String getHadoopConfDirPath(YamlConfig config){
  StringBuilder responseAppender=new StringBuilder();
  String response=RemotingUtil.executeCommand(config,ECHO_HADOOP_CONF_DIR);
  LOGGER.info("String_Node_Str" + response);
  if (response != null && !response.trim().isEmpty()) {
    return response;
  }
  responseAppender=responseAppender.append(getHadoopHomeDirPath(config)).append(File.separator).append(CONF_DIR);
  return responseAppender.toString();
}
Program: 130257
Project: 130257
Buggy source:
@Override public String getHadoopConfDirPath(YamlConfig config){
  String possibleDirList=RemotingUtil.executeCommand(config,WHEREIS_HADOOP);
  checkEmptyDir(possibleDirList);
  String[] splittedDirList=possibleDirList.split("String_Node_Str");
  String absoluteDirPath=null;
  for (int index=1; index < splittedDirList.length; index++) {
    absoluteDirPath=getAbsoluteConfDirPath(splittedDirList[index],config);
    if (absoluteDirPath != null && !absoluteDirPath.isEmpty()) {
      break;
    }
  }
  absoluteDirPath=absoluteDirPath.trim();
  checkEmptyDir(absoluteDirPath);
  return absoluteDirPath;
}

Fixed version (ground truth):
@Override public String getHadoopConfDirPath(YamlConfig config){
  String absoluteDirPath=null;
  absoluteDirPath=getAbsoluteConfDirPath(expectedConf,config);
  if (absoluteDirPath == null || absoluteDirPath.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str" + expectedConf);
  }
  LOGGER.debug("String_Node_Str" + absoluteDirPath);
  absoluteDirPath=absoluteDirPath.trim();
  checkEmptyDir(absoluteDirPath);
  return absoluteDirPath;
}
Program: 130258
Project: 130258
Buggy source:
private String getAbsoluteConfDirPath(String dir,YamlConfig config){
  String result=null, response=null;
  if (dir == null || dir.trim().isEmpty() || !dir.contains("String_Node_Str")) {
    throw new IllegalArgumentException(error_message);
  }
  response=RemotingUtil.executeCommand(config,LS_PREFIX_PART + dir + LS_CDH_POSTFIX_PART);
  if (response != null || !response.isEmpty()) {
    result=response.substring((response.indexOf("String_Node_Str") + 1),response.length());
  }
  result=result.endsWith(File.separator) ? result : result.trim() + File.separator;
  return result;
}

Fixed version (ground truth):
private String getAbsoluteConfDirPath(String dir,YamlConfig config){
  String result=null, response=null;
  if (dir == null || dir.trim().isEmpty() || !dir.contains("String_Node_Str")) {
    throw new IllegalArgumentException(error_message);
  }
  response=RemotingUtil.executeCommand(config,LS_PREFIX_PART + dir + LS_CDH_POSTFIX_PART);
  if (response != null && !response.isEmpty() && response.indexOf("String_Node_Str") != -1) {
    result=response.substring((response.indexOf("String_Node_Str") + 1),response.length());
    result=result.endsWith(File.separator) ? result : result.trim() + File.separator;
  }
  LOGGER.debug("String_Node_Str" + result);
  if (result != null) {
    String recursiveResponse=getAbsoluteConfDirPath(result,config);
    if (recursiveResponse != null) {
      result=recursiveResponse;
    }
  }
  return result;
}
Program: 130259
Project: 130259
Buggy source:
private void checkEmptyDir(String possibleDirList){
  if (possibleDirList == null || possibleDirList.isEmpty()) {
    throw new IllegalArgumentException(error_message);
  }
}

Fixed version (ground truth):
private boolean checkEmptyDir(String possibleDirList){
  if (possibleDirList == null || possibleDirList.isEmpty()) {
    return true;
  }
  return false;
}
Program: 130260
Project: 130260
Buggy source:
private String getAbsoluteConfDirPath(String dir,YamlConfig config){
  String result=null, response=null;
  if (dir == null || dir.trim().isEmpty() || !dir.contains("String_Node_Str")) {
    throw new IllegalArgumentException(error_message);
  }
  response=RemotingUtil.executeCommand(config,LS_PREFIX_PART + dir + LS_CDH_POSTFIX_PART);
  if (response != null && !response.isEmpty() && response.indexOf("String_Node_Str") != -1) {
    result=response.substring((response.indexOf("String_Node_Str") + 1),response.length());
    result=result.endsWith(File.separator) ? result : result.trim() + File.separator;
  }
  LOGGER.debug("String_Node_Str" + result);
  if (result != null) {
    String recursiveResponse=getAbsoluteConfDirPath(result,config);
    if (recursiveResponse != null) {
      result=recursiveResponse;
    }
  }
  return result;
}

Fixed version (ground truth):
private String getAbsoluteConfDirPath(String dir,YamlConfig config){
  String result=null, response=null;
  if (dir == null || dir.trim().isEmpty() || !dir.contains("String_Node_Str")) {
    throw new IllegalArgumentException(error_message);
  }
  response=RemotingUtil.executeCommand(config,LS_PREFIX_PART + dir + LS_CDH_POSTFIX_PART);
  int responseIndex=response.indexOf("String_Node_Str");
  if (response != null && !response.isEmpty() && responseIndex != -1) {
    result=response.substring((responseIndex + 1),response.length());
    result=result.endsWith(File.separator) ? result : result.trim() + File.separator;
  }
  LOGGER.debug("String_Node_Str" + result);
  if (result != null) {
    String recursiveResponse=getAbsoluteConfDirPath(result,config);
    if (recursiveResponse != null) {
      result=recursiveResponse;
    }
  }
  return result;
}
Program: 130261
Project: 130261
Buggy source:
/** 
 * This method is responsible for populating the clean up phase details.
 * @return TaskOutputDetails contains the details of the clean up phase.
 */
private PhaseDetails prepareCleanupDetails(JobInfo jobInfo,Map<TaskAttemptID,TaskAttemptInfo> tasks){
  PhaseDetails phaseDetails=new PhaseDetails();
  List<TaskOutputDetails> cleanupTaskOuptputDetails=new ArrayList<TaskOutputDetails>();
  TaskOutputDetails taskOutputDetails=new TaskOutputDetails();
  taskOutputDetails.setTaskType("String_Node_Str");
  taskOutputDetails.setTaskID("String_Node_Str");
  for (  Map.Entry<TaskAttemptID,TaskAttemptInfo> task : tasks.entrySet()) {
    TaskAttemptInfo taskAttemptInfo=(TaskAttemptInfo)(task.getValue());
    taskOutputDetails.setLocation(taskAttemptInfo.getHostname());
  }
  long startPoint=getMaxReduceTime(tasks,jobInfo.getSubmitTime());
  taskOutputDetails.setStartPoint(startPoint);
  LOGGER.info("String_Node_Str" + taskOutputDetails.getStartPoint());
  long endPoint=(jobInfo.getFinishTime() - jobInfo.getSubmitTime()) / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  taskOutputDetails.setEndPoint(endPoint);
  LOGGER.info("String_Node_Str" + taskOutputDetails.getEndPoint());
  taskOutputDetails.setDataFlowRate(0);
  cleanupTaskOuptputDetails.add(taskOutputDetails);
  phaseDetails.setTaskOutputDetails(cleanupTaskOuptputDetails);
  phaseDetails.setAvgDataFlowRate(0);
  return phaseDetails;
}

Fixed version (ground truth):
/** 
 * This method is responsible for populating the clean up phase details.
 * @return TaskOutputDetails contains the details of the clean up phase.
 */
private PhaseDetails prepareCleanupDetails(JobInfo jobInfo,Map<TaskAttemptID,TaskAttemptInfo> tasks){
  PhaseDetails phaseDetails=new PhaseDetails();
  List<TaskOutputDetails> cleanupTaskOuptputDetails=new ArrayList<TaskOutputDetails>();
  TaskOutputDetails taskOutputDetails=new TaskOutputDetails();
  taskOutputDetails.setTaskType("String_Node_Str");
  taskOutputDetails.setTaskID("String_Node_Str");
  for (  Map.Entry<TaskAttemptID,TaskAttemptInfo> task : tasks.entrySet()) {
    TaskAttemptInfo taskAttemptInfo=(TaskAttemptInfo)(task.getValue());
    taskOutputDetails.setLocation(taskAttemptInfo.getHostname());
  }
  long startPoint=getMaxReduceTime(tasks,jobInfo.getSubmitTime());
  taskOutputDetails.setStartPoint(startPoint);
  long endPoint=(jobInfo.getFinishTime() - jobInfo.getSubmitTime()) / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  taskOutputDetails.setEndPoint(endPoint);
  taskOutputDetails.setDataFlowRate(0);
  cleanupTaskOuptputDetails.add(taskOutputDetails);
  phaseDetails.setTaskOutputDetails(cleanupTaskOuptputDetails);
  phaseDetails.setAvgDataFlowRate(0);
  return phaseDetails;
}
Program: 130265
Project: 130265
Buggy source:
/** 
 * Gets the job counter beans.
 * @return the job counter beans
 */
public static List<JobCounterBean> getJobCounterBeans(){
  return jobCounterBeans;
}

Fixed version (ground truth):
/** 
 * Gets the job counter beans.
 * @return the job counter beans
 */
public List<JobCounterBean> getJobCounterBeans(){
  return jobCounterBeans;
}
Program: 130266
Project: 130266
Buggy source:
/** 
 * Fetch cluster configuration properties.
 * @param loader the loader
 * @return the string
 */
private static String fetchClusterConfigurationProperties(Loader loader){
  YamlLoader yamlLoader=(YamlLoader)loader;
  String expectedLocation=new StringBuilder().append(YamlLoader.getjHome()).append(File.separator).append(Constants.JOB_JARS_LOC).append(yamlLoader.getJumbuneJobName()).append("String_Node_Str").toString();
  File file=new File(expectedLocation);
  if (!file.exists() || file.isDirectory()) {
    Master master=yamlLoader.getMasterInfo();
    Remoter remoter=new Remoter(master.getHost(),Integer.valueOf(master.getAgentPort()));
    String relativePath=File.separator + Constants.JOB_JARS_LOC + yamlLoader.getJumbuneJobName();
    remoter.receiveLogFiles(relativePath,"String_Node_Str");
  }
  return expectedLocation;
}

Fixed version (ground truth):
/** 
 * Fetch cluster configuration properties.
 * @param loader the loader
 * @return the string
 */
private String fetchClusterConfigurationProperties(Loader loader){
  YamlLoader yamlLoader=(YamlLoader)loader;
  String expectedLocation=new StringBuilder().append(YamlLoader.getjHome()).append(File.separator).append(Constants.JOB_JARS_LOC).append(yamlLoader.getJumbuneJobName()).append("String_Node_Str").toString();
  File file=new File(expectedLocation);
  if (!file.exists() || file.isDirectory()) {
    Master master=yamlLoader.getMasterInfo();
    Remoter remoter=new Remoter(master.getHost(),Integer.valueOf(master.getAgentPort()));
    String relativePath=File.separator + Constants.JOB_JARS_LOC + yamlLoader.getJumbuneJobName();
    remoter.receiveLogFiles(relativePath,"String_Node_Str");
  }
  return expectedLocation;
}
Program: 130267
Project: 130267
Buggy source:
/** 
 * Process exception condition.
 * @param processName the process name
 * @param map the map
 * @param reader the reader
 * @param jobName the job name
 * @param line the line
 * @throws IOException Signals that an I/O exception has occurred.
 */
private static void processExceptionCondition(String processName,Map<String,String> map,BufferedReader reader,String jobName,String line) throws IOException {
  LOGGER.error("String_Node_Str" + line);
  map.put(ERRORANDEXCEPTION,line);
  while (true) {
    String lineTmp=line;
    lineTmp=reader.readLine();
    if (lineTmp == null) {
      break;
    }
    LOGGER.error(lineTmp);
  }
  JobCounterBean jobCounterBean=new JobCounterBean();
  jobCounterBean.setProcessName(processName);
  jobCounterBean.setJobName(jobName);
  jobCounterBean.setJobStatsMap(map);
  jobCounterBeans.add(jobCounterBean);
}

Fixed version (ground truth):
/** 
 * Process exception condition.
 * @param processName the process name
 * @param map the map
 * @param reader the reader
 * @param jobName the job name
 * @param line the line
 * @throws IOException Signals that an I/O exception has occurred.
 */
private void processExceptionCondition(String processName,Map<String,String> map,BufferedReader reader,String jobName,String line) throws IOException {
  LOGGER.error("String_Node_Str" + line);
  map.put(ERRORANDEXCEPTION,line);
  while (true) {
    String lineTmp=line;
    lineTmp=reader.readLine();
    if (lineTmp == null) {
      break;
    }
    LOGGER.error(lineTmp);
  }
  JobCounterBean jobCounterBean=new JobCounterBean();
  jobCounterBean.setProcessName(processName);
  jobCounterBean.setJobName(jobName);
  jobCounterBean.setJobStatsMap(map);
  jobCounterBeans.add(jobCounterBean);
}
Program: 130271
Project: 130271
Buggy source:
/** 
 * <p> </p>
 * @param bean Job process bean
 * @param jobCounterMap Existing map
 * @param yamlLoader
 * @param isDebugged
 * @throws IOException
 */
private void populateJobCounterMap(JobProcessBean bean,Map<String,Map<String,String>> jobCounterMap,Loader loader,Boolean isDebugged) throws IOException {
  if (isYarnJob) {
    jobCounterMap.putAll(getRemoteYarnJobCounters(bean.getJobName(),bean.getProcessResponse(),loader,isDebugged));
  }
 else {
    jobCounterMap.putAll(getRemoteJobCounters(bean.getJobName(),bean.getProcessResponse(),loader,isDebugged));
  }
  HadoopJobCounters.setJobCounterBeans(bean.getJobName(),bean.getProcessResponse(),loader);
}

Fixed version (ground truth):
/** 
 * <p> </p>
 * @param bean Job process bean
 * @param jobCounterMap Existing map
 * @param yamlLoader
 * @param isDebugged
 * @throws IOException
 */
private void populateJobCounterMap(JobProcessBean bean,Map<String,Map<String,String>> jobCounterMap,Loader loader,Boolean isDebugged) throws IOException {
  if (isYarnJob) {
    jobCounterMap.putAll(getRemoteYarnJobCounters(bean.getJobName(),bean.getProcessResponse(),loader,isDebugged));
  }
 else {
    jobCounterMap.putAll(getRemoteJobCounters(bean.getJobName(),bean.getProcessResponse(),loader,isDebugged));
  }
  hadoopJobCounters=new HadoopJobCounters();
  hadoopJobCounters.setJobCounterBeans(bean.getJobName(),bean.getProcessResponse(),loader);
}
Program: 130273
Project: 130273
Buggy source:
/** 
 * Gets the value by job name and property.
 * @param jobList the job list
 * @param jobName the job name
 * @param property the property
 * @return the value by job name and property
 */
public String getValueByJobNameAndProperty(List<JobCounterBean> jobList,String jobName,String property){
  for (  JobCounterBean bean : jobList) {
    if (bean.getJobName().equalsIgnoreCase(jobName)) {
      return bean.getJobStatsMap().get(property);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the value by job name and property.
 * @param jobList the job list
 * @param jobName the job name
 * @param property the property
 * @return the value by job name and property
 */
public String getValueByJobNameAndProperty(String jobName,String property){
  for (  JobCounterBean bean : jobCounterBeans) {
    if (bean.getJobName().equalsIgnoreCase(jobName)) {
      return bean.getJobStatsMap().get(property);
    }
  }
  return null;
}
Program: 130275
Project: 130275
Buggy source:
/** 
 * Generate the list of files and make them into DataValidationFileSplit.
 * @param job the job
 * @return the splits
 * @throws IOException Signals that an I/O exception has occurred.
 */
@Override public List<InputSplit> getSplits(JobContext job) throws IOException {
  long minSize=Math.max(getFormatMinSplitSize(),getMinSplitSize(job));
  long maxSize=getMaxSplitSize(job);
  List<InputSplit> splits=new ArrayList<InputSplit>();
  for (  FileStatus file : listStatus(job)) {
    generateSplits(job,minSize,maxSize,splits,file);
  }
  LOGGER.debug("String_Node_Str" + splits.size());
  return splits;
}

Fixed version (ground truth):
/** 
 * Generate the list of files and make them into DataValidationFileSplit.
 * @param job the job
 * @return the splits
 * @throws IOException Signals that an I/O exception has occurred.
 */
@Override public List<InputSplit> getSplits(JobContext job) throws IOException {
  long minSize=Math.max(getFormatMinSplitSize(),getMinSplitSize(job));
  long maxSize=getMaxSplitSize(job);
  List<InputSplit> splits=new ArrayList<InputSplit>();
  setData(job,minSize,maxSize,splits,listStatus(job));
  LOGGER.debug("String_Node_Str" + splits.size());
  return splits;
}
Program: 130276
Project: 130276
Buggy source:
@SuppressWarnings("String_Node_Str") protected void setup(Mapper.Context context) throws IOException, InterruptedException {
  String dvBeanString=context.getConfiguration().get(DataValidationConstants.DATA_VALIDATION_BEAN_STRING);
  Gson gson=new Gson();
  Type type=new TypeToken<DataValidationBean>(){
  }
.getType();
  DataValidationBean dataValidationBean=gson.fromJson(dvBeanString,type);
  fieldSeparator=dataValidationBean.getFieldSeparator();
  fieldSeparator=fieldSeparator.replaceAll(Constants.SPACE_SEPARATOR,Constants.SPACE);
  fieldValidationList=dataValidationBean.getFieldValidationList();
  expectedNumOfFields=dataValidationBean.getNumOfFields();
  InputSplit is=context.getInputSplit();
  if (is instanceof DataValidationFileSplit) {
    fileName=((DataValidationFileSplit)is).getPath().getName();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void setup(Mapper.Context context) throws IOException, InterruptedException {
  String dvBeanString=context.getConfiguration().get(DataValidationConstants.DATA_VALIDATION_BEAN_STRING);
  Gson gson=new Gson();
  Type type=new TypeToken<DataValidationBean>(){
  }
.getType();
  DataValidationBean dataValidationBean=gson.fromJson(dvBeanString,type);
  fieldSeparator=dataValidationBean.getFieldSeparator();
  fieldSeparator=fieldSeparator.replaceAll(Constants.SPACE_SEPARATOR,Constants.SPACE);
  fieldValidationList=dataValidationBean.getFieldValidationList();
  expectedNumOfFields=dataValidationBean.getNumOfFields();
  InputSplit is=context.getInputSplit();
  if (is instanceof DataValidationFileSplit) {
    fileName=((DataValidationFileSplit)is).getPath().toUri().getPath();
    fileName=fileName.replaceAll("String_Node_Str","String_Node_Str").substring(1,fileName.length());
  }
}
Program: 130277
Project: 130277
Buggy source:
/** 
 * Gets the job client.
 * @param loader the loader
 * @return the job client
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static JobClient getJobClient(Loader loader) throws IOException {
  String jobTrackerURI=RemotingUtil.getHadoopConfigurationValue(loader,"String_Node_Str","String_Node_Str");
  JobClient client=null;
  Configuration config=new Configuration();
  YamlLoader yamlLoader=(YamlLoader)loader;
  YamlConfig yamlConfig=(YamlConfig)yamlLoader.getYamlConfiguration();
  config.set(yamlConfig.getMaster().getUser(),"String_Node_Str");
  if (Enable.TRUE.equals(yamlConfig.getEnableYarn())) {
    config.set(MRConfig.FRAMEWORK_NAME,MRConfig.YARN_FRAMEWORK_NAME);
  }
  try {
    if (StringUtil.emptyOrNull(jobTrackerURI)) {
      client=new JobClient(new InetSocketAddress("String_Node_Str",8032),config);
    }
 else {
      client=new JobClient(new InetSocketAddress(jobTrackerURI.split("String_Node_Str")[0],Integer.parseInt(jobTrackerURI.split("String_Node_Str")[1])),config);
    }
  }
 catch (  Exception e) {
    LOGGER.error(e);
  }
  return client;
}

Fixed version (ground truth):
/** 
 * Gets the job client.
 * @param loader the loader
 * @return the job client
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static JobClient getJobClient(Loader loader) throws IOException {
  String jobTrackerURI=RemotingUtil.getHadoopConfigurationValue(loader,"String_Node_Str","String_Node_Str");
  JobClient client=null;
  Configuration config=new Configuration();
  YamlLoader yamlLoader=(YamlLoader)loader;
  YamlConfig yamlConfig=(YamlConfig)yamlLoader.getYamlConfiguration();
  config.set(yamlConfig.getMaster().getUser(),"String_Node_Str");
  if (Enable.TRUE.equals(yamlConfig.getEnableYarn())) {
    config.set("String_Node_Str","String_Node_Str");
  }
  try {
    if (StringUtil.emptyOrNull(jobTrackerURI)) {
      client=new JobClient(new InetSocketAddress("String_Node_Str",8032),config);
    }
 else {
      client=new JobClient(new InetSocketAddress(jobTrackerURI.split("String_Node_Str")[0],Integer.parseInt(jobTrackerURI.split("String_Node_Str")[1])),config);
    }
  }
 catch (  Exception e) {
    LOGGER.error(e);
  }
  return client;
}
Program: 130278
Project: 130278
Buggy source:
/** 
 * * this method validate the inputs of debugging in jumbune.In web UI this field is in Debug Analysis tab
 * @param config the config
 */
private void validateDebugField(Config config){
  YamlLoader yamlLoader=new YamlLoader(config);
  Map<String,String> failedDebug=new HashMap<String,String>();
  Map<String,String> suggestionDebug=new HashMap<String,String>();
  YamlConfig yamlConfig=(YamlConfig)config;
  if (yamlLoader.isInstrumentEnabled(Constants.DEBUG_INSTR_REGEX_KEY)) {
    if (!yamlConfig.getRegexValidations().isEmpty()) {
      checkFieldsValue(yamlConfig.getRegexValidations(),ErrorMessages.DEBUG_REGEX_CLASS_INVALID,ErrorMessages.DEBUG_REGEX_KEY_INVALID,failedDebug,"String_Node_Str");
    }
 else {
      failedDebug.put("String_Node_Str",errorMessages.get(ErrorMessages.DEBUG_REGEX_VALIDATION_EMPTY));
    }
  }
  if (yamlLoader.isInstrumentEnabled(Constants.DEBUG_INST_USER_KEY)) {
    if (!yamlConfig.getUserValidations().isEmpty()) {
      checkFieldsValue(yamlConfig.getUserValidations(),ErrorMessages.DEBUG_INST_REGEX_INVALID,ErrorMessages.DEBUG_INST_KEY_INVALID,failedDebug,"String_Node_Str");
    }
 else {
      failedDebug.put("String_Node_Str",errorMessages.get(ErrorMessages.DEBUG_USERDEFINE_VALIDATION_EMPTY));
    }
  }
  addToValidationList(Constants.DEBUGGER_VALIDATION,failedDebug,suggestionDebug);
}

Fixed version (ground truth):
/** 
 * * this method validate the inputs of debugging in jumbune.In web UI this field is in Debug Analysis tab
 * @param config the config
 */
private void validateDebugField(Config config){
  YamlLoader yamlLoader=new YamlLoader(config);
  Map<String,String> failedDebug=new HashMap<String,String>();
  Map<String,String> suggestionDebug=new HashMap<String,String>();
  YamlConfig yamlConfig=(YamlConfig)config;
  if (!ifDebuggerValidationsEnabled(config)) {
    failedDebug.put("String_Node_Str",errorMessages.get(ErrorMessages.BOTH_DEBUGGER_VALIDATIONS_NULL));
  }
  if (yamlLoader.isInstrumentEnabled(Constants.DEBUG_INSTR_REGEX_KEY)) {
    if (!yamlConfig.getRegexValidations().isEmpty()) {
      checkFieldsValue(yamlConfig.getRegexValidations(),ErrorMessages.DEBUG_REGEX_CLASS_INVALID,ErrorMessages.DEBUG_REGEX_KEY_INVALID,failedDebug,"String_Node_Str");
    }
 else {
      failedDebug.put("String_Node_Str",errorMessages.get(ErrorMessages.DEBUG_REGEX_VALIDATION_EMPTY));
    }
  }
  if (yamlLoader.isInstrumentEnabled(Constants.DEBUG_INST_USER_KEY)) {
    if (!yamlConfig.getUserValidations().isEmpty()) {
      checkFieldsValue(yamlConfig.getUserValidations(),ErrorMessages.DEBUG_INST_REGEX_INVALID,ErrorMessages.DEBUG_INST_KEY_INVALID,failedDebug,"String_Node_Str");
    }
 else {
      failedDebug.put("String_Node_Str",errorMessages.get(ErrorMessages.DEBUG_USERDEFINE_VALIDATION_EMPTY));
    }
  }
  addToValidationList(Constants.DEBUGGER_VALIDATION,failedDebug,suggestionDebug);
}
Program: 130279
Project: 130279
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + distributedHDFSPath + "String_Node_Str"+ master+ "String_Node_Str"+ slaves+ "String_Node_Str"+ hadoopJobProfile+ "String_Node_Str"+ enableYarn+ "String_Node_Str"+ enableDataValidation+ "String_Node_Str"+ debugAnalysis+ "String_Node_Str"+ enableStaticJobProfiling+ "String_Node_Str"+ profilingParams+ "String_Node_Str"+ jobs+ "String_Node_Str"+ includeClassJar+ "String_Node_Str"+ inputFile+ "String_Node_Str"+ doNotInstrument+ "String_Node_Str"+ Arrays.toString(mapperSuperClasses)+ "String_Node_Str"+ Arrays.toString(reducerSuperClasses)+ "String_Node_Str"+ debuggerConf+ "String_Node_Str"+ classpath+ "String_Node_Str"+ regexValidations+ "String_Node_Str"+ userValidations+ "String_Node_Str"+ partitionerSampleInterval+ "String_Node_Str"+ sJumbuneHome+ "String_Node_Str"+ hdfsInputPath+ "String_Node_Str"+ dataValidation+ "String_Node_Str"+ jumbuneJobName+ "String_Node_Str"+ slaveParam+ "String_Node_Str"+ runJobFromJumbune+ "String_Node_Str"+ existingJobName+ "String_Node_Str"+ isLocalSystemJar+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + distributedHDFSPath + "String_Node_Str"+ master+ "String_Node_Str"+ slaves+ "String_Node_Str"+ hadoopJobProfile+ "String_Node_Str"+ enableYarn+ "String_Node_Str"+ enableDataValidation+ "String_Node_Str"+ debugAnalysis+ "String_Node_Str"+ enableStaticJobProfiling+ "String_Node_Str"+ profilingParams+ "String_Node_Str"+ jobs+ "String_Node_Str"+ includeClassJar+ "String_Node_Str"+ inputFile+ "String_Node_Str"+ doNotInstrument+ "String_Node_Str"+ Arrays.toString(mapperSuperClasses)+ "String_Node_Str"+ Arrays.toString(reducerSuperClasses)+ "String_Node_Str"+ debuggerConf+ "String_Node_Str"+ classpath+ "String_Node_Str"+ logKeyValues+ "String_Node_Str"+ regexValidations+ "String_Node_Str"+ userValidations+ "String_Node_Str"+ partitionerSampleInterval+ "String_Node_Str"+ sJumbuneHome+ "String_Node_Str"+ hdfsInputPath+ "String_Node_Str"+ dataValidation+ "String_Node_Str"+ jumbuneJobName+ "String_Node_Str"+ slaveParam+ "String_Node_Str"+ runJobFromJumbune+ "String_Node_Str"+ existingJobName+ "String_Node_Str"+ isLocalSystemJar+ "String_Node_Str";
}
Program: 130280
Project: 130280
Buggy source:
/** 
 * * create object of ErrorMessageLoader class if it is not instantiated otherwise returns already used object this method load message file as an input stream.
 * @return single instance of ErrorMessageLoader
 */
public static ErrorMessageLoader getInstance(){
  if (instance == null) {
    final String messageFileName=INPUT_VALIDATION_MESSAGE_FILE;
    final InputStream msgStream=ErrorMessageLoader.class.getClassLoader().getResourceAsStream(messageFileName);
    try {
      instance=new ErrorMessageLoader(msgStream);
    }
 catch (    JumbuneException e) {
      LOGGER.error(e);
    }
 finally {
      try {
        if (msgStream != null) {
          msgStream.close();
        }
      }
 catch (      IOException e) {
        LOGGER.error(e.getMessage());
      }
    }
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * * create object of ErrorMessageLoader class if it is not instantiated otherwise returns already used object this method load message file as an input stream.
 * @return single instance of ErrorMessageLoader
 */
public static ErrorMessageLoader getInstance(){
  if (instance == null) {
    final String messageFileName=inputValidationMessageFile;
    final InputStream msgStream=ErrorMessageLoader.class.getClassLoader().getResourceAsStream(messageFileName);
    try {
      instance=new ErrorMessageLoader(msgStream);
    }
 catch (    JumbuneException e) {
      LOGGER.error(e);
    }
 finally {
      try {
        if (msgStream != null) {
          msgStream.close();
        }
      }
 catch (      IOException e) {
        LOGGER.error(e.getMessage());
      }
    }
  }
  return instance;
}
Program: 130281
Project: 130281
Buggy source:
/** 
 * Checks if is atleast one module enabled.
 * @param config the config
 * @return true, if is atleast one module enabled
 */
private boolean isAtleastOneModuleEnabled(Config config){
  boolean result=false;
  YamlConfig yamlConfig=(YamlConfig)config;
  boolean isProfiling=isProfilingModuleEnabled(config);
  if (isEnable(yamlConfig.getEnableDataValidation()) || isEnable(yamlConfig.getHadoopJobProfile()) || isEnable(yamlConfig.getDebugAnalysis())|| isProfiling) {
    result=true;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Checks if is atleast one module enabled.
 * @param config the config
 * @return true, if is atleast one module enabled
 */
protected boolean isAtleastOneModuleEnabled(Config config){
  boolean result=false;
  YamlConfig yamlConfig=(YamlConfig)config;
  boolean isProfiling=isProfilingModuleEnabled(config);
  if (isEnable(yamlConfig.getEnableDataValidation()) || isEnable(yamlConfig.getHadoopJobProfile()) || isEnable(yamlConfig.getDebugAnalysis())|| isProfiling) {
    result=true;
  }
  return result;
}
Program: 130282
Project: 130282
Buggy source:
/** 
 * Checks if  profiling module enabled.
 * @param config the config
 * @return true, if profiling module is enabled
 */
private boolean isProfilingModuleEnabled(Config config){
  boolean result=false;
  YamlConfig yamlConfig=(YamlConfig)config;
  if (isEnable(yamlConfig.getEnableStaticJobProfiling())) {
    result=true;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Checks if  profiling module enabled.
 * @param config the config
 * @return true, if profiling module is enabled
 */
protected boolean isProfilingModuleEnabled(Config config){
  boolean result=false;
  YamlConfig yamlConfig=(YamlConfig)config;
  if (isEnable(yamlConfig.getEnableStaticJobProfiling())) {
    result=true;
  }
  return result;
}
Program: 130283
Project: 130283
Buggy source:
/** 
 * This method is called to get job parameters.
 * @param jobDef
 * @param inputJarPath
 * @param isMainClassDefined Is main class defined in jar manifest
 * @return List<String>
 */
private List<String> getJobExecutionParams(String hadoopHome,JobDefinition jobDef,String inputJarPath,boolean isMainClassDefined,String jobName){
  List<String> jobExeParaList=new ArrayList<String>();
  jobExeParaList.add(hadoopHome + YamlLoader.getHadoopCommand());
  jobExeParaList.add(YamlLoader.getHadoopCommandType());
  jobExeParaList.add(inputJarPath);
  if (!isMainClassDefined) {
    jobExeParaList.add(jobDef.getJobClass());
  }
  jobExeParaList.add(Constants.LIB_JARS);
  String jarNames=addUserSuppliedDependencyJars(jobName);
  jobExeParaList.add(hadoopHome + Constants.LOG4J2_API_JAR + "String_Node_Str"+ hadoopHome+ Constants.LOG4J2_CORE_JAR+ jarNames);
  if (jobDef.getParameters() != null) {
    populateJobExecParamList(jobDef,jobExeParaList);
  }
  return jobExeParaList;
}

Fixed version (ground truth):
/** 
 * This method is called to get job parameters.
 * @param jobDef
 * @param inputJarPath
 * @param isMainClassDefined Is main class defined in jar manifest
 * @return List<String>
 */
private List<String> getJobExecutionParams(String hadoopHome,JobDefinition jobDef,String inputJarPath,boolean isMainClassDefined,String jobName){
  List<String> jobExeParaList=new ArrayList<String>();
  jobExeParaList.add(hadoopHome + YamlLoader.getHadoopCommand());
  jobExeParaList.add(YamlLoader.getHadoopCommandType());
  jobExeParaList.add(inputJarPath);
  if (!isMainClassDefined) {
    jobExeParaList.add(jobDef.getJobClass());
  }
  jobExeParaList.add(Constants.LIB_JARS);
  String jarNames=addUserSuppliedDependencyJars(jobName);
  jobExeParaList.add("String_Node_Str" + Constants.LOG4J2_API_JAR + "String_Node_Str"+ Constants.LOG4J2_CORE_JAR+ jarNames);
  if (jobDef.getParameters() != null) {
    populateJobExecParamList(jobDef,jobExeParaList);
  }
  return jobExeParaList;
}
Program: 130284
Project: 130284
Buggy source:
/** 
 * Constructs a   {@link MapPcpRequest} object by parsing a buffer.
 * @param buffer buffer containing PCP request data
 * @throws NullPointerException if any argument is {@code null}
 * @throws IllegalArgumentException if any numeric argument is negative, or if {@code buffer} isn't the right size (max of 1100 bytes)or is malformed ( {@code r-flag != 0 || op != 1 || 0L > lifetime > 0xFFFFFFFFL || mappingNonce.length != 12 || 0 > protocol > 255|| 0 > internalPort > 65535 || 0 > suggestedExternalPort > 65535 || (protocol == 0 && internalPort != 0) || (internalPort == 0 && lifetime != 0)}) or contains an unparseable options region.
 */
public MapPcpRequest(byte[] buffer){
  super(buffer,DATA_LENGTH);
  Validate.isTrue(super.getOp() == OPCODE);
  int remainingLength=buffer.length - HEADER_LENGTH;
  Validate.isTrue(remainingLength >= DATA_LENGTH);
  int offset=HEADER_LENGTH;
  mappingNonce=new byte[NONCE_LENGTH];
  System.arraycopy(buffer,offset,mappingNonce,0,mappingNonce.length);
  offset+=mappingNonce.length;
  protocol=buffer[offset] & 0xFF;
  offset++;
  offset+=3;
  internalPort=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  suggestedExternalPort=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  suggestedExternalIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  validateState();
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link MapPcpRequest} object by parsing a buffer.
 * @param buffer buffer containing PCP request data
 * @throws NullPointerException if any argument is {@code null}
 * @throws IllegalArgumentException if any numeric argument is negative, or if {@code buffer} isn't the right size (max of 1100 bytes)or is malformed ( {@code r-flag != 0 || op != 1 || 0L > lifetime > 0xFFFFFFFFL || mappingNonce.length != 12 || 0 > protocol > 255|| 0 > internalPort > 65535 || 0 > suggestedExternalPort > 65535 || (protocol == 0 && internalPort != 0) || (internalPort == 0 && lifetime != 0)}) or contains an unparseable options region.
 */
public MapPcpRequest(byte[] buffer){
  super(buffer,DATA_LENGTH);
  Validate.isTrue(super.getOp() == OPCODE);
  int remainingLength=buffer.length - HEADER_LENGTH;
  Validate.isTrue(remainingLength >= DATA_LENGTH);
  int offset=HEADER_LENGTH;
  mappingNonce=new byte[NONCE_LENGTH];
  System.arraycopy(buffer,offset,mappingNonce,0,mappingNonce.length);
  offset+=mappingNonce.length;
  protocol=buffer[offset] & 0xFF;
  offset++;
  offset+=3;
  internalPort=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  suggestedExternalPort=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  suggestedExternalIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  validateState();
}
Program: 130286
Project: 130286
Buggy source:
/** 
 * Constructs a   {@link MapPcpRequest} object by parsing a buffer.
 * @param buffer buffer containing PCP request data
 * @throws NullPointerException if any argument is {@code null}
 * @throws IllegalArgumentException if any numeric argument is negative, or if {@code buffer} isn't the right size (max of 1100 bytes)or is malformed ( {@code r-flag != 0 || op == 2 || 0L > lifetime > 0xFFFFFFFFL || mappingNonce.length != 12|| 1 > protocol > 255 || 1 > internalPort > 65535 || 0 > suggestedExternalPort > 65535 || 1 > remotePeerPort > 65535}) or contains an unparseable options region.
 */
public PeerPcpRequest(byte[] buffer){
  super(buffer,DATA_LENGTH);
  Validate.isTrue(super.getOp() == OPCODE);
  int remainingLength=buffer.length - HEADER_LENGTH;
  Validate.isTrue(remainingLength >= DATA_LENGTH);
  int offset=HEADER_LENGTH;
  mappingNonce=new byte[NONCE_LENGTH];
  System.arraycopy(buffer,offset,mappingNonce,0,mappingNonce.length);
  offset+=mappingNonce.length;
  protocol=buffer[offset] & 0xFF;
  offset++;
  offset+=3;
  internalPort=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  suggestedExternalPort=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  suggestedExternalIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  remotePeerPort=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  offset+=2;
  remotePeerIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  validateState();
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link MapPcpRequest} object by parsing a buffer.
 * @param buffer buffer containing PCP request data
 * @throws NullPointerException if any argument is {@code null}
 * @throws IllegalArgumentException if any numeric argument is negative, or if {@code buffer} isn't the right size (max of 1100 bytes)or is malformed ( {@code r-flag != 0 || op == 2 || 0L > lifetime > 0xFFFFFFFFL || mappingNonce.length != 12|| 1 > protocol > 255 || 1 > internalPort > 65535 || 0 > suggestedExternalPort > 65535 || 1 > remotePeerPort > 65535}) or contains an unparseable options region.
 */
public PeerPcpRequest(byte[] buffer){
  super(buffer,DATA_LENGTH);
  Validate.isTrue(super.getOp() == OPCODE);
  int remainingLength=buffer.length - HEADER_LENGTH;
  Validate.isTrue(remainingLength >= DATA_LENGTH);
  int offset=HEADER_LENGTH;
  mappingNonce=new byte[NONCE_LENGTH];
  System.arraycopy(buffer,offset,mappingNonce,0,mappingNonce.length);
  offset+=mappingNonce.length;
  protocol=buffer[offset] & 0xFF;
  offset++;
  offset+=3;
  internalPort=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  suggestedExternalPort=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  suggestedExternalIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  remotePeerPort=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  offset+=2;
  remotePeerIpAddress=NetworkUtils.convertBytesToAddress(buffer,offset,16);
  offset+=16;
  validateState();
}
Program: 130288
Project: 130288
Buggy source:
NatPmpResponse(byte[] buffer){
  Validate.notNull(buffer);
  Validate.isTrue(buffer.length >= HEADER_LENGTH);
  int offset=0;
  int version=buffer[offset] & 0xFF;
  Validate.isTrue(version == NAT_PMP_VERSION);
  offset++;
  op=buffer[offset] & 0xFF;
  offset++;
  resultCode=InternalUtils.bytesToShort(buffer,offset);
  offset+=2;
  secondsSinceStartOfEpoch=InternalUtils.bytesToInt(buffer,offset) & 0xFFFFFFFFL;
  offset+=4;
  validateState();
}

Fixed version (ground truth):
NatPmpResponse(byte[] buffer){
  Validate.notNull(buffer);
  Validate.isTrue(buffer.length >= HEADER_LENGTH);
  int offset=0;
  int version=buffer[offset] & 0xFF;
  Validate.isTrue(version == NAT_PMP_VERSION);
  offset++;
  op=buffer[offset] & 0xFF;
  offset++;
  resultCode=InternalUtils.bytesToShort(buffer,offset) & 0xFFFF;
  offset+=2;
  secondsSinceStartOfEpoch=InternalUtils.bytesToInt(buffer,offset) & 0xFFFFFFFFL;
  offset+=4;
  validateState();
}
Program: 130289
Project: 130289
Buggy source:
private static String readIp4(String text,int offset){
  try {
    String component1=readIp4Component(text,offset);
    offset+=component1.length();
    Validate.isTrue(text.codePointAt(offset) == '.');
    offset++;
    String component2=readIp4Component(text,offset);
    offset+=component2.length();
    Validate.isTrue(text.codePointAt(offset) == '.');
    offset++;
    String component3=readIp4Component(text,offset);
    offset+=component3.length();
    Validate.isTrue(text.codePointAt(offset) == '.');
    offset++;
    String component4=readIp4Component(text,offset);
    offset+=component4.length();
    return component1 + '.' + component2+ '.'+ component3+ '.'+ component4;
  }
 catch (  IndexOutOfBoundsException e) {
    throw new IllegalArgumentException(e);
  }
}

Fixed version (ground truth):
private static String readIp4(String text,int offset){
  try {
    String component1=readIp4Component(text,offset);
    offset+=component1.length();
    Validate.isTrue(text.codePointAt(offset) == '.');
    offset++;
    String component2=readIp4Component(text,offset);
    offset+=component2.length();
    Validate.isTrue(text.codePointAt(offset) == '.');
    offset++;
    String component3=readIp4Component(text,offset);
    offset+=component3.length();
    Validate.isTrue(text.codePointAt(offset) == '.');
    offset++;
    String component4=readIp4Component(text,offset);
    return component1 + '.' + component2+ '.'+ component3+ '.'+ component4;
  }
 catch (  IndexOutOfBoundsException e) {
    throw new IllegalArgumentException(e);
  }
}
Program: 130290
Project: 130290
Buggy source:
private static Map<String,String> generateHeaders(String host){
  Validate.notNull(host);
  Map<String,String> ret=new HashMap<>();
  ret.put("String_Node_Str",host);
  ret.put("String_Node_Str","String_Node_Str");
  return ret;
}

Fixed version (ground truth):
private static Map<String,String> generateHeaders(String host){
  Validate.notNull(host);
  Map<String,String> ret=new LinkedHashMap<>();
  ret.put("String_Node_Str",host);
  ret.put("String_Node_Str","String_Node_Str");
  return ret;
}
Program: 130291
Project: 130291
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final ExternalAddressNatPmpRequest other=(ExternalAddressNatPmpRequest)obj;
  if (!super.equals(obj)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  if (!super.equals(obj)) {
    return false;
  }
  return true;
}