nus-yam/ex-repair huggingface dataset:
Program: 90056
Project: 90056
Buggy source:
/** 
 * Test the create user method for user already exists.
 * @throws IOException If there is any problem.
 * @throws GenieException If there is any problem.
 */
@Test public void testCreateUserMethodSuccessDoesNotExist1() throws IOException, GenieException {
  final String user="String_Node_Str";
  final String group="String_Node_Str";
  final CommandLine idCheckCommandLine=new CommandLine("String_Node_Str");
  idCheckCommandLine.addArgument("String_Node_Str");
  idCheckCommandLine.addArgument(user);
  Mockito.when(this.executor.execute(Mockito.any())).thenThrow(IOException.class);
  final ArgumentCaptor<CommandLine> argumentCaptor=ArgumentCaptor.forClass(CommandLine.class);
  final List<String> command=Arrays.asList("String_Node_Str","String_Node_Str",user,"String_Node_Str",group,"String_Node_Str");
  try {
    this.jobKickoffTask.createUser(user,group);
  }
 catch (  GenieException ge) {
    log.debug("String_Node_Str");
  }
  Mockito.verify(this.executor,Mockito.times(2)).execute(argumentCaptor.capture());
  Assert.assertArrayEquals(command.toArray(),argumentCaptor.getAllValues().get(1).toStrings());
}

Fixed version (ground truth):
/** 
 * Test the create user method for user already exists.
 * @throws IOException If there is any problem.
 * @throws GenieException If there is any problem.
 */
@Test public void testCreateUserMethodSuccessDoesNotExist1() throws IOException, GenieException {
  final String user="String_Node_Str";
  final String group="String_Node_Str";
  final CommandLine idCheckCommandLine=new CommandLine("String_Node_Str");
  idCheckCommandLine.addArgument("String_Node_Str");
  idCheckCommandLine.addArgument(user);
  Mockito.when(this.executor.execute(Mockito.any())).thenThrow(IOException.class);
  final ArgumentCaptor<CommandLine> argumentCaptor=ArgumentCaptor.forClass(CommandLine.class);
  final List<String> command=Arrays.asList("String_Node_Str","String_Node_Str",user,"String_Node_Str",group,"String_Node_Str");
  try {
    this.jobKickoffTask.createUser(user,group);
  }
 catch (  GenieException ge) {
    log.debug("String_Node_Str");
  }
  Mockito.verify(this.executor,Mockito.times(3)).execute(argumentCaptor.capture());
  Assert.assertArrayEquals(command.toArray(),argumentCaptor.getAllValues().get(2).toStrings());
}
Program: 90057
Project: 90057
Buggy source:
/** 
 * Test the change ownership method for success.
 * @throws IOException If there is any problem.
 * @throws GenieException If there is any problem.
 */
@Test public void testChangeOwnershipOfDirectoryMethodSuccess() throws IOException, GenieException {
  final String user="String_Node_Str";
  final String dir="String_Node_Str";
  final ArgumentCaptor<CommandLine> argumentCaptor=ArgumentCaptor.forClass(CommandLine.class);
  final List<String> command=Arrays.asList("String_Node_Str","String_Node_Str",user,dir);
  this.jobKickoffTask.changeOwnershipOfDirectory(dir,user);
  Mockito.verify(this.executor).execute(argumentCaptor.capture());
  Assert.assertArrayEquals(command.toArray(),argumentCaptor.getValue().toStrings());
}

Fixed version (ground truth):
/** 
 * Test the change ownership method for success.
 * @throws IOException If there is any problem.
 * @throws GenieException If there is any problem.
 */
@Test public void testChangeOwnershipOfDirectoryMethodSuccess() throws IOException, GenieException {
  final String user="String_Node_Str";
  final String dir="String_Node_Str";
  final ArgumentCaptor<CommandLine> argumentCaptor=ArgumentCaptor.forClass(CommandLine.class);
  final List<String> command=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str",user,dir);
  this.jobKickoffTask.changeOwnershipOfDirectory(dir,user);
  Mockito.verify(this.executor).execute(argumentCaptor.capture());
  Assert.assertArrayEquals(command.toArray(),argumentCaptor.getValue().toStrings());
}
Program: 90058
Project: 90058
Buggy source:
/** 
 * Uploads the job directory to the archive location.
 * @param jobId The job id.
 * @throws GenieException if there is any problem
 */
public void archivedJobDir(final String jobId) throws GenieException {
  try {
    log.debug("String_Node_Str");
    final Job job=this.jobSearchService.getJob(jobId);
    if (StringUtils.isNotBlank(job.getArchiveLocation())) {
      final String jobWorkingDir=this.baseWorkingDir + JobConstants.FILE_PATH_DELIMITER + jobId;
      final String localArchiveFile=jobWorkingDir + JobConstants.FILE_PATH_DELIMITER + jobId+ "String_Node_Str";
      final CommandLine commandLine=new CommandLine("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument(localArchiveFile);
      commandLine.addArgument("String_Node_Str");
      executor.setWorkingDirectory(new File(jobWorkingDir));
      executor.execute(commandLine);
      this.genieFileTransferService.putFile(localArchiveFile,job.getArchiveLocation());
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",jobId,e);
  }
}

Fixed version (ground truth):
/** 
 * Uploads the job directory to the archive location.
 * @param jobId The job id.
 * @throws GenieException if there is any problem
 */
public void archivedJobDir(final String jobId) throws GenieException {
  try {
    log.debug("String_Node_Str");
    final Job job=this.jobSearchService.getJob(jobId);
    if (StringUtils.isNotBlank(job.getArchiveLocation())) {
      final String jobWorkingDir=this.baseWorkingDir + JobConstants.FILE_PATH_DELIMITER + jobId;
      final String localArchiveFile=jobWorkingDir + JobConstants.FILE_PATH_DELIMITER + "String_Node_Str"+ jobId+ "String_Node_Str";
      final CommandLine commandLine=new CommandLine("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument(localArchiveFile);
      commandLine.addArgument("String_Node_Str");
      executor.setWorkingDirectory(new File(jobWorkingDir));
      executor.execute(commandLine);
      this.genieFileTransferService.putFile(localArchiveFile,job.getArchiveLocation());
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",jobId,e);
  }
}
Program: 90059
Project: 90059
Buggy source:
/** 
 * Main method that uses the JobClient.
 * @param args The args to the main application.
 * @throws Exception For all other issues.
 */
public static void main(final String[] args) throws Exception {
  log.debug("String_Node_Str");
  final Configurations configs=new Configurations();
  final Configuration configuration=configs.properties("String_Node_Str");
  final JobClient jobClient=new JobClient(new GenieClientConfigurationCommonsConfigImpl(configuration));
  final String commandArgs="String_Node_Str";
  final List<ClusterCriteria> clusterCriteriaList=new ArrayList<>();
  final String clusterTag="String_Node_Str";
  final ClusterCriteria clusterCriteria=new ClusterCriteria(Sets.newHashSet(clusterTag));
  clusterCriteriaList.add(clusterCriteria);
  final HashSet<String> tags=new HashSet<>();
  tags.add("String_Node_Str");
  tags.add("String_Node_Str");
  final String commandTag="String_Node_Str";
  final Set<String> commandCriteria=Sets.newHashSet(commandTag);
  final JobRequest jobRequest=new JobRequest.Builder("String_Node_Str","String_Node_Str","String_Node_Str",commandArgs,clusterCriteriaList,commandCriteria).withDisableLogArchival(true).withTags(tags).build();
  jobClient.getJobs().forEach(job -> log.info(job.toString()));
}

Fixed version (ground truth):
/** 
 * Main method that uses the JobClient.
 * @param args The args to the main application.
 * @throws Exception For all other issues.
 */
public static void main(final String[] args) throws Exception {
  log.debug("String_Node_Str");
  final Configurations configs=new Configurations();
  final Configuration configuration=configs.properties("String_Node_Str");
  final JobClient jobClient=new JobClient(new GenieClientConfigurationCommonsConfigImpl(configuration));
  final String commandArgs="String_Node_Str";
  final List<ClusterCriteria> clusterCriteriaList=new ArrayList<>();
  final String clusterTag="String_Node_Str";
  final ClusterCriteria clusterCriteria=new ClusterCriteria(Sets.newHashSet(clusterTag));
  clusterCriteriaList.add(clusterCriteria);
  final HashSet<String> tags=new HashSet<>();
  tags.add("String_Node_Str");
  tags.add("String_Node_Str");
  final String commandTag="String_Node_Str";
  final Set<String> commandCriteria=Sets.newHashSet(commandTag);
  final JobRequest jobRequest=new JobRequest.Builder("String_Node_Str","String_Node_Str","String_Node_Str",commandArgs,clusterCriteriaList,commandCriteria).withDisableLogArchival(true).withTags(tags).build();
  final String jobId=jobClient.submitJob(jobRequest);
  log.info(jobClient.getJob(jobId).toString());
  log.info(jobClient.getJobRequest(jobId).toString());
  log.info(jobClient.getJobCluster(jobId).toString());
  log.info(jobClient.getJobCommand(jobId).toString());
  log.info(jobClient.getJobExecution(jobId).toString());
  jobClient.getJobs().forEach(job -> log.info(job.toString()));
}
Program: 90060
Project: 90060
Buggy source:
/** 
 * Method to set exit code for the job execution.
 * @param id       the id of the job to update the exit code
 * @param exitCode The exit code of the process
 * @throws GenieException if there is an error
 */
@Override public synchronized void setExitCode(@NotBlank(message="String_Node_Str") final String id,@NotBlank(message="String_Node_Str") final int exitCode) throws GenieException {
  log.debug("String_Node_Str",id,exitCode);
  final JobExecutionEntity jobExecutionEntity=this.jobExecutionRepo.findOne(id);
  if (jobExecutionEntity != null) {
    if (jobExecutionEntity.getExitCode() == JobExecution.DEFAULT_EXIT_CODE) {
switch (exitCode) {
case JobExecution.DEFAULT_EXIT_CODE:
        break;
case JobExecution.KILLED_EXIT_CODE:
      this.updateJobStatus(id,JobStatus.KILLED,"String_Node_Str");
    break;
case JobExecution.ZOMBIE_EXIT_CODE:
  this.updateJobStatus(id,JobStatus.FAILED,"String_Node_Str");
break;
case JobExecution.SUCCESS_EXIT_CODE:
this.updateJobStatus(id,JobStatus.SUCCEEDED,"String_Node_Str");
break;
default :
this.updateJobStatus(id,JobStatus.FAILED,"String_Node_Str");
}
jobExecutionEntity.setExitCode(exitCode);
}
 else {
throw new GeniePreconditionException("String_Node_Str");
}
}
 else {
throw new GenieNotFoundException("String_Node_Str" + id);
}
}

Fixed version (ground truth):
/** 
 * Method to set exit code for the job execution.
 * @param id       the id of the job to update the exit code
 * @param exitCode The exit code of the process
 * @throws GenieException if there is an error
 */
@Override public synchronized void setExitCode(@NotBlank(message="String_Node_Str") final String id,@NotBlank(message="String_Node_Str") final int exitCode) throws GenieException {
  log.debug("String_Node_Str",id,exitCode);
  final JobExecutionEntity jobExecutionEntity=this.jobExecutionRepo.findOne(id);
  if (jobExecutionEntity != null) {
    if (jobExecutionEntity.getExitCode() == JobExecution.DEFAULT_EXIT_CODE) {
switch (exitCode) {
case JobExecution.DEFAULT_EXIT_CODE:
        break;
case JobExecution.KILLED_EXIT_CODE:
      this.updateJobStatus(id,JobStatus.KILLED,"String_Node_Str");
    break;
case JobExecution.ZOMBIE_EXIT_CODE:
  this.updateJobStatus(id,JobStatus.FAILED,"String_Node_Str");
break;
case JobExecution.SUCCESS_EXIT_CODE:
this.updateJobStatus(id,JobStatus.SUCCEEDED,"String_Node_Str");
break;
default :
this.updateJobStatus(id,JobStatus.FAILED,"String_Node_Str");
}
jobExecutionEntity.setExitCode(exitCode);
}
 else {
if (jobExecutionEntity.getExitCode() != exitCode) {
throw new GeniePreconditionException("String_Node_Str");
}
}
}
 else {
throw new GenieNotFoundException("String_Node_Str" + id);
}
}
Program: 90061
Project: 90061
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void putFile(@NotBlank(message="String_Node_Str") final String srcLocalPath,@NotBlank(message="String_Node_Str") final String dstRemotePath) throws GenieException {
  log.debug("String_Node_Str",srcLocalPath,dstRemotePath);
  try {
    final File src=new File(srcLocalPath);
    final File dest=new File(dstRemotePath);
    Files.copy(src.toPath(),dest.toPath());
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",srcLocalPath,dstRemotePath);
    throw new GenieServerException("String_Node_Str" + dstRemotePath + "String_Node_Str"+ srcLocalPath,ioe);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void putFile(@NotBlank(message="String_Node_Str") final String srcLocalPath,@NotBlank(message="String_Node_Str") final String dstRemotePath) throws GenieException {
  log.debug("String_Node_Str",srcLocalPath,dstRemotePath);
  try {
    final File src=new File(srcLocalPath);
    final File dest=new File(dstRemotePath);
    Files.copy(src.toPath(),dest.toPath());
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",srcLocalPath,dstRemotePath);
    throw new GenieServerException("String_Node_Str" + srcLocalPath + "String_Node_Str"+ dstRemotePath,ioe);
  }
}
Program: 90062
Project: 90062
Buggy source:
/** 
 * Sends an email when the job is completed.
 * @param jobId The job id.
 * @throws GenieException If there is any problem.
 */
public void sendEmail(final String jobId) throws GenieException {
  log.debug("String_Node_Str");
  final JobRequest jobRequest=this.jobSearchService.getJobRequest(jobId);
  final Job job=this.jobSearchService.getJob(jobId);
  if (org.apache.commons.lang3.StringUtils.isNotBlank(jobRequest.getEmail())) {
    final String message=new StringBuilder().append("String_Node_Str").append(jobId).append("String_Node_Str").append(job.getStatus()).toString();
    this.mailServiceImpl.sendEmail(jobRequest.getEmail(),message,message);
  }
}

Fixed version (ground truth):
/** 
 * Sends an email when the job is completed.
 * @param jobId The job id.
 * @throws GenieException If there is any problem.
 */
public void sendEmail(final String jobId) throws GenieException {
  try {
    log.debug("String_Node_Str");
    final JobRequest jobRequest=this.jobSearchService.getJobRequest(jobId);
    final Job job=this.jobSearchService.getJob(jobId);
    if (org.apache.commons.lang3.StringUtils.isNotBlank(jobRequest.getEmail())) {
      final String message=new StringBuilder().append("String_Node_Str").append(jobId).append("String_Node_Str").append(job.getStatus()).toString();
      this.mailServiceImpl.sendEmail(jobRequest.getEmail(),message,message);
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",jobId,e);
  }
}
Program: 90063
Project: 90063
Buggy source:
/** 
 * An external fail-safe mechanism to clean up processes left behind by the run.sh after the job is killed or failed.
 * @param pid The process id.
 * @throws GenieException
 */
private void cleanupProcesses(final int pid) throws GenieException {
  final CommandLine commandLine=new CommandLine(JobConstants.UNIX_PKILL_COMMAND);
  commandLine.addArgument(JobConstants.getKillFlag());
  commandLine.addArgument(Integer.toString(pid));
  try {
    executor.execute(commandLine);
  }
 catch (  IOException ioe) {
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * An external fail-safe mechanism to clean up processes left behind by the run.sh after the job is killed or failed.
 * @param pid The process id.
 * @throws GenieException
 */
private void cleanupProcesses(final int pid) throws GenieException {
  try {
    final CommandLine commandLine=new CommandLine(JobConstants.UNIX_PKILL_COMMAND);
    commandLine.addArgument(JobConstants.getKillFlag());
    commandLine.addArgument(Integer.toString(pid));
    executor.execute(commandLine);
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",e);
  }
}
Program: 90064
Project: 90064
Buggy source:
/** 
 * Updates the status of the job.
 * @param jobId The job id.
 * @throws GenieException If there is any problem
 */
public void updateExitCode(final String jobId) throws GenieException {
  log.debug("String_Node_Str");
  final ObjectMapper objectMapper=new ObjectMapper();
  try {
    final JobDoneFile jobDoneFile=objectMapper.readValue(new File(baseWorkingDir + "String_Node_Str" + jobId+ "String_Node_Str"),JobDoneFile.class);
    final int exitCode=jobDoneFile.getExitCode();
    this.jobPersistenceService.setExitCode(jobId,exitCode);
  }
 catch (  final IOException ioe) {
    log.error("String_Node_Str",jobId);
    this.jobPersistenceService.updateJobStatus(jobId,JobStatus.FAILED,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Updates the status of the job.
 * @param jobId The job id.
 * @throws GenieException If there is any problem
 */
public void updateExitCode(final String jobId) throws GenieException {
  try {
    log.debug("String_Node_Str");
    final ObjectMapper objectMapper=new ObjectMapper();
    try {
      final JobDoneFile jobDoneFile=objectMapper.readValue(new File(baseWorkingDir + "String_Node_Str" + jobId+ "String_Node_Str"),JobDoneFile.class);
      final int exitCode=jobDoneFile.getExitCode();
      this.jobPersistenceService.setExitCode(jobId,exitCode);
    }
 catch (    final IOException ioe) {
      log.error("String_Node_Str",jobId);
      this.jobPersistenceService.updateJobStatus(jobId,JobStatus.FAILED,"String_Node_Str");
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",jobId,e);
  }
}
Program: 90065
Project: 90065
Buggy source:
/** 
 * Uploads the job directory to the archive location.
 * @param jobId The job id.
 * @throws GenieException if there is any problem
 */
public void archivedJobDir(final String jobId) throws GenieException {
  log.debug("String_Node_Str");
  final Job job=this.jobSearchService.getJob(jobId);
  if (StringUtils.isNotBlank(job.getArchiveLocation())) {
    final String jobWorkingDir=this.baseWorkingDir + JobConstants.FILE_PATH_DELIMITER + jobId;
    final String localArchiveFile=jobWorkingDir + JobConstants.FILE_PATH_DELIMITER + jobId+ "String_Node_Str";
    final CommandLine commandLine=new CommandLine("String_Node_Str");
    commandLine.addArgument("String_Node_Str");
    commandLine.addArgument("String_Node_Str");
    commandLine.addArgument("String_Node_Str");
    commandLine.addArgument(localArchiveFile);
    commandLine.addArgument("String_Node_Str");
    executor.setWorkingDirectory(new File(jobWorkingDir));
    try {
      executor.execute(commandLine);
    }
 catch (    IOException ioe) {
      throw new GenieServerException("String_Node_Str" + jobId + ioe);
    }
    this.genieFileTransferService.putFile(localArchiveFile,job.getArchiveLocation());
  }
}

Fixed version (ground truth):
/** 
 * Uploads the job directory to the archive location.
 * @param jobId The job id.
 * @throws GenieException if there is any problem
 */
public void archivedJobDir(final String jobId) throws GenieException {
  try {
    log.debug("String_Node_Str");
    final Job job=this.jobSearchService.getJob(jobId);
    if (StringUtils.isNotBlank(job.getArchiveLocation())) {
      final String jobWorkingDir=this.baseWorkingDir + JobConstants.FILE_PATH_DELIMITER + jobId;
      final String localArchiveFile=jobWorkingDir + JobConstants.FILE_PATH_DELIMITER + jobId+ "String_Node_Str";
      final CommandLine commandLine=new CommandLine("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument("String_Node_Str");
      commandLine.addArgument(localArchiveFile);
      commandLine.addArgument("String_Node_Str");
      executor.setWorkingDirectory(new File(jobWorkingDir));
      executor.execute(commandLine);
      this.genieFileTransferService.putFile(localArchiveFile,job.getArchiveLocation());
    }
  }
 catch (  Exception e) {
    log.debug("String_Node_Str",jobId,e);
  }
}
Program: 90066
Project: 90066
Buggy source:
/** 
 * Constructor used by the builder build() method.
 * @param builder The builder to use
 */
public JobExecutionEnvironment(final Builder builder){
  this.jobRequest=builder.jobRequest;
  this.cluster=builder.cluster;
  this.command=builder.command;
  this.applications.addAll(builder.applications);
  this.jobWorkingDir=builder.jobWorkingDir;
}

Fixed version (ground truth):
/** 
 * Constructor used by the builder build() method.
 * @param builder The builder to use
 */
public JobExecutionEnvironment(final Builder builder){
  this.jobRequest=builder.bJobRequest;
  this.cluster=builder.bCluster;
  this.command=builder.bCommand;
  this.applications.addAll(builder.bApplications);
  this.jobWorkingDir=builder.bJobWorkingDir;
}
Program: 90067
Project: 90067
Buggy source:
/** 
 * Constructor.
 * @param request The job request object.
 * @param clusterObj The cluster object.
 * @param commandObj The command object.
 * @param dir The directory location for the jobs
 * @throws GenieException If there is an error
 */
public Builder(@NotNull(message="String_Node_Str") final JobRequest request,@NotNull(message="String_Node_Str") final Cluster clusterObj,@NotNull(message="String_Node_Str") final Command commandObj,@NotBlank(message="String_Node_Str") final File dir) throws GenieException {
  this.jobRequest=request;
  this.cluster=clusterObj;
  this.command=commandObj;
  this.jobWorkingDir=dir;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param request The job request object.
 * @param clusterObj The cluster object.
 * @param commandObj The command object.
 * @param dir The directory location for the jobs
 * @throws GenieException If there is an error
 */
public Builder(@NotNull(message="String_Node_Str") final JobRequest request,@NotNull(message="String_Node_Str") final Cluster clusterObj,@NotNull(message="String_Node_Str") final Command commandObj,@NotBlank(message="String_Node_Str") final File dir) throws GenieException {
  this.bJobRequest=request;
  this.bCluster=clusterObj;
  this.bCommand=commandObj;
  this.bJobWorkingDir=dir;
}
Program: 90068
Project: 90068
Buggy source:
/** 
 * Set the applications needed for the jobs' execution.
 * @param applications The list of application objects.
 * @return The builder
 */
public Builder withApplications(final List<Application> applications){
  if (applications != null) {
    this.applications.addAll(applications);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Set the applications needed for the jobs' execution.
 * @param applications The list of application objects.
 * @return The builder
 */
public Builder withApplications(final List<Application> applications){
  if (applications != null) {
    this.bApplications.addAll(applications);
  }
  return this;
}
Program: 90070
Project: 90070
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void executeTask(@NotNull final Map<String,Object> context) throws GenieException {
  log.debug("String_Node_Str");
  super.executeTask(context);
  final Writer writer=Utils.getWriter(runScript);
  createEntityInstanceDirectory(this.jobExecEnv.getCluster().getId(),Constants.AdminResources.CLUSTER);
  final String clusterSetupFile=jobExecEnv.getCluster().getSetupFile();
  if (clusterSetupFile != null && StringUtils.isNotBlank(clusterSetupFile)) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCommand().getId(),clusterSetupFile,Constants.FileType.SETUP,Constants.AdminResources.CLUSTER);
    fts.getFile(clusterSetupFile,localPath);
    Utils.appendToWriter(writer,"String_Node_Str" + localPath + "String_Node_Str");
  }
  for (  final String configFile : jobExecEnv.getCluster().getConfigs()) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCluster().getId(),configFile,Constants.FileType.CONFIG,Constants.AdminResources.CLUSTER);
    this.fts.getFile(configFile,localPath);
  }
  Utils.closeWriter(writer);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void executeTask(@NotNull final Map<String,Object> context) throws GenieException {
  log.debug("String_Node_Str");
  super.executeTask(context);
  final Writer writer=Utils.getWriter(runScript);
  createEntityInstanceDirectory(this.jobExecEnv.getCluster().getId(),Constants.AdminResources.CLUSTER);
  createEntityInstanceConfigDirectory(this.jobExecEnv.getCluster().getId(),Constants.AdminResources.CLUSTER);
  createEntityInstanceDependenciesDirectory(this.jobExecEnv.getCluster().getId(),Constants.AdminResources.CLUSTER);
  final String clusterSetupFile=jobExecEnv.getCluster().getSetupFile();
  if (clusterSetupFile != null && StringUtils.isNotBlank(clusterSetupFile)) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCluster().getId(),clusterSetupFile,Constants.FileType.SETUP,Constants.AdminResources.CLUSTER);
    fts.getFile(clusterSetupFile,localPath);
    Utils.appendToWriter(writer,"String_Node_Str" + localPath + "String_Node_Str");
  }
  for (  final String configFile : jobExecEnv.getCluster().getConfigs()) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCluster().getId(),configFile,Constants.FileType.CONFIG,Constants.AdminResources.CLUSTER);
    this.fts.getFile(configFile,localPath);
  }
  Utils.closeWriter(writer);
}
Program: 90071
Project: 90071
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void executeTask(@NotNull final Map<String,Object> context) throws GenieException {
  log.debug("String_Node_Str");
  super.executeTask(context);
  final Writer writer=Utils.getWriter(runScript);
  createEntityInstanceDirectory(this.jobExecEnv.getCluster().getId(),Constants.AdminResources.COMMAND);
  final String commandSetupFile=jobExecEnv.getCommand().getSetupFile();
  if (commandSetupFile != null && StringUtils.isNotBlank(commandSetupFile)) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCommand().getId(),commandSetupFile,Constants.FileType.SETUP,Constants.AdminResources.COMMAND);
    this.fts.getFile(commandSetupFile,localPath);
    Utils.appendToWriter(writer,"String_Node_Str" + localPath + "String_Node_Str");
  }
  for (  final String configFile : jobExecEnv.getCommand().getConfigs()) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCommand().getId(),configFile,Constants.FileType.CONFIG,Constants.AdminResources.COMMAND);
    this.fts.getFile(configFile,localPath);
  }
  Utils.closeWriter(writer);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void executeTask(@NotNull final Map<String,Object> context) throws GenieException {
  log.debug("String_Node_Str");
  super.executeTask(context);
  final Writer writer=Utils.getWriter(runScript);
  createEntityInstanceDirectory(this.jobExecEnv.getCommand().getId(),Constants.AdminResources.COMMAND);
  createEntityInstanceConfigDirectory(this.jobExecEnv.getCommand().getId(),Constants.AdminResources.COMMAND);
  createEntityInstanceDependenciesDirectory(this.jobExecEnv.getCommand().getId(),Constants.AdminResources.COMMAND);
  final String commandSetupFile=jobExecEnv.getCommand().getSetupFile();
  if (commandSetupFile != null && StringUtils.isNotBlank(commandSetupFile)) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCommand().getId(),commandSetupFile,Constants.FileType.SETUP,Constants.AdminResources.COMMAND);
    this.fts.getFile(commandSetupFile,localPath);
    Utils.appendToWriter(writer,"String_Node_Str" + localPath + "String_Node_Str");
  }
  for (  final String configFile : jobExecEnv.getCommand().getConfigs()) {
    final String localPath=super.buildLocalFilePath(this.jobWorkigDirectory,jobExecEnv.getCommand().getId(),configFile,Constants.FileType.CONFIG,Constants.AdminResources.COMMAND);
    this.fts.getFile(configFile,localPath);
  }
  Utils.closeWriter(writer);
}
Program: 90072
Project: 90072
Buggy source:
/** 
 * Constructor.
 * @param executor The executor to use to launch processes
 */
@Autowired public LocalFileTransferImpl(final Executor executor){
  this.executor=executor;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param executor The executor to use to launch processes
 */
@Autowired public LocalFileTransferImpl(final Executor executor){
  this.executor=executor;
  this.resourceLoader=new DefaultResourceLoader();
}
Program: 90073
Project: 90073
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void getFile(@NotBlank(message="String_Node_Str") final String srcRemotePath,@NotBlank(message="String_Node_Str") final String dstLocalPath) throws GenieException {
  log.debug("String_Node_Str",srcRemotePath,dstLocalPath);
  final CommandLine commandLine=new CommandLine("String_Node_Str");
  commandLine.addArgument(srcRemotePath);
  commandLine.addArgument(dstLocalPath);
  try {
    this.executor.execute(commandLine);
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",srcRemotePath,dstLocalPath);
    throw new GenieServerException("String_Node_Str" + srcRemotePath + "String_Node_Str"+ dstLocalPath,ioe);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void getFile(@NotBlank(message="String_Node_Str") final String srcRemotePath,@NotBlank(message="String_Node_Str") final String dstLocalPath) throws GenieException {
  log.debug("String_Node_Str",srcRemotePath,dstLocalPath);
  try {
    final File src=this.resourceLoader.getResource(srcRemotePath).getFile();
    final File dest=new File(dstLocalPath);
    Files.copy(src.toPath(),dest.toPath());
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",srcRemotePath,dstLocalPath);
    throw new GenieServerException("String_Node_Str" + srcRemotePath + "String_Node_Str"+ dstLocalPath,ioe);
  }
}
Program: 90074
Project: 90074
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void putFile(@NotBlank(message="String_Node_Str") final String srcLocalPath,@NotBlank(message="String_Node_Str") final String dstRemotePath) throws GenieException {
  log.debug("String_Node_Str",srcLocalPath,dstRemotePath);
  final CommandLine commandLine=new CommandLine("String_Node_Str");
  commandLine.addArgument(srcLocalPath);
  commandLine.addArgument(dstRemotePath);
  try {
    this.executor.execute(commandLine);
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",srcLocalPath,dstRemotePath);
    throw new GenieServerException("String_Node_Str" + dstRemotePath + "String_Node_Str"+ srcLocalPath,ioe);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void putFile(@NotBlank(message="String_Node_Str") final String srcLocalPath,@NotBlank(message="String_Node_Str") final String dstRemotePath) throws GenieException {
  log.debug("String_Node_Str",srcLocalPath,dstRemotePath);
  try {
    final File src=new File(srcLocalPath);
    final File dest=this.resourceLoader.getResource(dstRemotePath).getFile();
    Files.copy(src.toPath(),dest.toPath());
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",srcLocalPath,dstRemotePath);
    throw new GenieServerException("String_Node_Str" + dstRemotePath + "String_Node_Str"+ srcLocalPath,ioe);
  }
}
Program: 90075
Project: 90075
Buggy source:
/** 
 * Test the putFile method.
 * @throws GenieException If there is any problem
 * @throws IOException If there is any problem
 */
@Test(expected=GenieServerException.class) public void testPutFileMethod() throws GenieException, IOException {
  final ArgumentCaptor<CommandLine> argument=ArgumentCaptor.forClass(CommandLine.class);
  Mockito.when(this.executor.execute(Mockito.any())).thenThrow(IOException.class);
  this.localFileTransfer.putFile(SOURCE_FILE,DESTINATION_FILE);
  Mockito.verify(this.executor).execute(argument.capture());
  final List<String> expectedCommandLine=new ArrayList<>();
  expectedCommandLine.add(COPY_COMMAND);
  expectedCommandLine.add(SOURCE_FILE);
  expectedCommandLine.add(DESTINATION_FILE);
  Assert.assertArrayEquals(expectedCommandLine.toArray(),argument.getValue().getArguments());
}

Fixed version (ground truth):
/** 
 * Test the putFile method.
 * @throws GenieException If there is any problem
 * @throws IOException If there is any problem
 */
@Test(expected=GenieServerException.class) @Ignore public void testPutFileMethod() throws GenieException, IOException {
}
Program: 90076
Project: 90076
Buggy source:
/** 
 * Test the getFile method.
 * @throws GenieException If there is any problem
 * @throws IOException If there is any problem
 */
@Test(expected=GenieServerException.class) public void testGetFileMethod() throws GenieException, IOException {
  final ArgumentCaptor<CommandLine> argument=ArgumentCaptor.forClass(CommandLine.class);
  Mockito.when(this.executor.execute(Mockito.any())).thenThrow(IOException.class);
  this.localFileTransfer.getFile(SOURCE_FILE,DESTINATION_FILE);
  Mockito.verify(this.executor).execute(argument.capture());
  final List<String> expectedCommandLine=new ArrayList<>();
  expectedCommandLine.add(COPY_COMMAND);
  expectedCommandLine.add(SOURCE_FILE);
  expectedCommandLine.add(DESTINATION_FILE);
  Assert.assertArrayEquals(expectedCommandLine.toArray(),argument.getValue().getArguments());
}

Fixed version (ground truth):
/** 
 * Test the getFile method.
 * @throws GenieException If there is any problem
 * @throws IOException If there is any problem
 */
@Test @Ignore public void testGetFileMethod() throws GenieException, IOException {
}
Program: 90077
Project: 90077
Buggy source:
/** 
 * Takes in a Job Request persists it in db and then hands of the job to submitter interface to submit.
 * @param jobRequest of job to run
 * @param clientHost Hostname of the client sending request
 * @throws GenieException if there is an error
 */
@Override public String coordinateJob(@NotNull(message="String_Node_Str") @Valid final JobRequest jobRequest,final String clientHost) throws GenieException {
  log.debug("String_Node_Str",jobRequest);
  final JobRequest jobRequestWithId=this.jobPersistenceService.createJobRequest(jobRequest);
  if (StringUtils.isNotBlank(clientHost)) {
    this.jobPersistenceService.addClientHostToJobRequest(jobRequestWithId.getId(),clientHost);
  }
  String jobArchivalLocation=null;
  if (!jobRequestWithId.isDisableLogArchival()) {
    if (baseArchiveLocation == null) {
      throw new GeniePreconditionException("String_Node_Str");
    }
    jobArchivalLocation=baseArchiveLocation + "String_Node_Str" + jobRequestWithId.getId();
  }
  final Job job=new Job.Builder(jobRequest.getName(),jobRequest.getUser(),jobRequest.getVersion()).withArchiveLocation(jobArchivalLocation).withDescription(jobRequest.getDescription()).withId(jobRequestWithId.getId()).withStatus(JobStatus.INIT).withStatusMsg("String_Node_Str").build();
  this.jobPersistenceService.createJob(job);
  this.jobSubmitterService.submitJob(jobRequestWithId);
  return jobRequestWithId.getId();
}

Fixed version (ground truth):
/** 
 * Takes in a Job Request persists it in db and then hands of the job to submitter interface to submit.
 * @param jobRequest of job to run
 * @param clientHost Hostname of the client sending request
 * @return The id of the job just submitted.
 * @throws GenieException if there is an error
 */
@Override public String coordinateJob(@NotNull(message="String_Node_Str") @Valid final JobRequest jobRequest,final String clientHost) throws GenieException {
  log.debug("String_Node_Str",jobRequest);
  final JobRequest jobRequestWithId=this.jobPersistenceService.createJobRequest(jobRequest);
  if (StringUtils.isNotBlank(clientHost)) {
    this.jobPersistenceService.addClientHostToJobRequest(jobRequestWithId.getId(),clientHost);
  }
  String jobArchivalLocation=null;
  if (!jobRequestWithId.isDisableLogArchival()) {
    if (baseArchiveLocation == null) {
      throw new GeniePreconditionException("String_Node_Str");
    }
    jobArchivalLocation=baseArchiveLocation + "String_Node_Str" + jobRequestWithId.getId();
  }
  final Job job=new Job.Builder(jobRequest.getName(),jobRequest.getUser(),jobRequest.getVersion()).withArchiveLocation(jobArchivalLocation).withDescription(jobRequest.getDescription()).withId(jobRequestWithId.getId()).withStatus(JobStatus.INIT).withStatusMsg("String_Node_Str").build();
  this.jobPersistenceService.createJob(job);
  this.jobSubmitterService.submitJob(jobRequestWithId);
  return jobRequestWithId.getId();
}
Program: 90078
Project: 90078
Buggy source:
@Test @Ignore public void testGetJobs(){
}

Fixed version (ground truth):
/** 
 * Test the get jobs method.
 * @throws GenieException If there is any problem
 */
@Test @Ignore public void testGetJobs() throws GenieException {
}
Program: 90079
Project: 90079
Buggy source:
@Test public void testGetJob() throws GenieException {
  final ArgumentCaptor<String> argument=ArgumentCaptor.forClass(String.class);
  this.jobCoordinatorService.getJob(JOB_1_ID);
  Mockito.verify(this.jobPersistenceService).getJob(argument.capture());
  Assert.assertEquals(JOB_1_ID,argument.getValue());
}

Fixed version (ground truth):
/** 
 * Test the get job method to verify that the id sent is used to fetch from persistence service.
 * @throws GenieException If there is any problem
 */
@Test public void testGetJob() throws GenieException {
  final ArgumentCaptor<String> argument=ArgumentCaptor.forClass(String.class);
  this.jobCoordinatorService.getJob(JOB_1_ID);
  Mockito.verify(this.jobPersistenceService).getJob(argument.capture());
  Assert.assertEquals(JOB_1_ID,argument.getValue());
}
Program: 90080
Project: 90080
Buggy source:
@Test public void testCoordinateJobArchiveLocationEnabled() throws GenieException {
  final String clientHost="String_Node_Str";
  final JobRequest jobRequest=new JobRequest.Builder(JOB_1_NAME,JOB_1_USER,JOB_1_VERSION,null,null,null).withDisableLogArchival(false).withId(JOB_1_ID).build();
  Mockito.when(this.jobPersistenceService.createJobRequest(Mockito.eq(jobRequest))).thenReturn(jobRequest);
  final ArgumentCaptor<Job> argument=ArgumentCaptor.forClass(Job.class);
  this.jobCoordinatorService.coordinateJob(jobRequest,clientHost);
  Mockito.verify(this.jobPersistenceService).createJob(argument.capture());
  Assert.assertEquals(BASE_ARCHIVE_LOCATION + "String_Node_Str" + JOB_1_ID,argument.getValue().getArchiveLocation());
}

Fixed version (ground truth):
/** 
 * Test the coordinate job method with archive location enabled.
 * @throws GenieException If there is any problem
 */
@Test public void testCoordinateJobArchiveLocationEnabled() throws GenieException {
  final String clientHost="String_Node_Str";
  final JobRequest jobRequest=new JobRequest.Builder(JOB_1_NAME,JOB_1_USER,JOB_1_VERSION,null,null,null).withDisableLogArchival(false).withId(JOB_1_ID).build();
  Mockito.when(this.jobPersistenceService.createJobRequest(Mockito.eq(jobRequest))).thenReturn(jobRequest);
  final ArgumentCaptor<Job> argument=ArgumentCaptor.forClass(Job.class);
  this.jobCoordinatorService.coordinateJob(jobRequest,clientHost);
  Mockito.verify(this.jobPersistenceService).createJob(argument.capture());
  Assert.assertEquals(BASE_ARCHIVE_LOCATION + "String_Node_Str" + JOB_1_ID,argument.getValue().getArchiveLocation());
}
Program: 90081
Project: 90081
Buggy source:
@Test public void testCoordinateJobArchiveLocationDisabled() throws GenieException {
  final String clientHost="String_Node_Str";
  final JobRequest jobRequest=new JobRequest.Builder(JOB_1_NAME,JOB_1_USER,JOB_1_VERSION,null,null,null).withDisableLogArchival(true).withId(JOB_1_ID).build();
  Mockito.when(this.jobPersistenceService.createJobRequest(Mockito.eq(jobRequest))).thenReturn(jobRequest);
  final ArgumentCaptor<Job> argument=ArgumentCaptor.forClass(Job.class);
  this.jobCoordinatorService.coordinateJob(jobRequest,clientHost);
  Mockito.verify(this.jobPersistenceService).createJob(argument.capture());
  Assert.assertNull(argument.getValue().getArchiveLocation());
}

Fixed version (ground truth):
/** 
 * Test the coordinate job method with archive location disabled.
 * @throws GenieException If there is any problem
 */
@Test public void testCoordinateJobArchiveLocationDisabled() throws GenieException {
  final String clientHost="String_Node_Str";
  final JobRequest jobRequest=new JobRequest.Builder(JOB_1_NAME,JOB_1_USER,JOB_1_VERSION,null,null,null).withDisableLogArchival(true).withId(JOB_1_ID).build();
  Mockito.when(this.jobPersistenceService.createJobRequest(Mockito.eq(jobRequest))).thenReturn(jobRequest);
  final ArgumentCaptor<Job> argument=ArgumentCaptor.forClass(Job.class);
  this.jobCoordinatorService.coordinateJob(jobRequest,clientHost);
  Mockito.verify(this.jobPersistenceService).createJob(argument.capture());
  Assert.assertNull(argument.getValue().getArchiveLocation());
}
Program: 90082
Project: 90082
Buggy source:
@Test(expected=GeniePreconditionException.class) public void testCoordinateJobArchiveLocationEnabledBaseLocationMissing() throws GenieException {
  final String clientHost="String_Node_Str";
  final JobRequest jobRequest=new JobRequest.Builder(JOB_1_NAME,JOB_1_USER,JOB_1_VERSION,null,null,null).withDisableLogArchival(false).withId(JOB_1_ID).build();
  Mockito.when(this.jobPersistenceService.createJobRequest(Mockito.eq(jobRequest))).thenReturn(jobRequest);
  final ArgumentCaptor<Job> argument=ArgumentCaptor.forClass(Job.class);
  final JobCoordinatorService jobCoordinatorService=new JobCoordinatorServiceImpl(this.jobPersistenceService,this.jobSearchService,this.jobSubmitterService,null);
  jobCoordinatorService.coordinateJob(jobRequest,clientHost);
  Mockito.verify(this.jobPersistenceService).createJob(argument.capture());
  Assert.assertEquals(BASE_ARCHIVE_LOCATION + "String_Node_Str" + JOB_1_ID,argument.getValue().getArchiveLocation());
}

Fixed version (ground truth):
/** 
 * Test the coordinate job method with archive location enabled but base archive directory not set.
 * @throws GenieException If there is any problem
 */
@Test(expected=GeniePreconditionException.class) public void testCoordinateJobArchiveLocationEnabledBaseLocationMissing() throws GenieException {
  final String clientHost="String_Node_Str";
  final JobRequest jobRequest=new JobRequest.Builder(JOB_1_NAME,JOB_1_USER,JOB_1_VERSION,null,null,null).withDisableLogArchival(false).withId(JOB_1_ID).build();
  Mockito.when(this.jobPersistenceService.createJobRequest(Mockito.eq(jobRequest))).thenReturn(jobRequest);
  final ArgumentCaptor<Job> argument=ArgumentCaptor.forClass(Job.class);
  final JobCoordinatorService jcs=new JobCoordinatorServiceImpl(this.jobPersistenceService,this.jobSearchService,this.jobSubmitterService,null);
  jcs.coordinateJob(jobRequest,clientHost);
  Mockito.verify(this.jobPersistenceService).createJob(argument.capture());
  Assert.assertEquals(BASE_ARCHIVE_LOCATION + "String_Node_Str" + JOB_1_ID,argument.getValue().getArchiveLocation());
}
Program: 90083
Project: 90083
Buggy source:
/** 
 * Constructor Initialize the object using Job execution environment object.
 * @param fileCopyServiceImpls List of implementations of the file copy interface
 * @param jobExecEnv           The job execution environment details like the job, cluster,command and applications
 * @param mode Whether to run it in full genie mode or just local.
 * @throws GenieException Exception in case of an error
 */
public JobExecutor(final List<FileCopyService> fileCopyServiceImpls,@NotNull(message="String_Node_Str") final JobExecutionEnvironment jobExecEnv,final String mode) throws GenieException {
  this.fileCopyServiceImpls=fileCopyServiceImpls;
  this.jobExecEnv=jobExecEnv;
  this.mode=mode;
  if ((this.jobExecEnv.getJobWorkingDir() == null) || (StringUtils.isBlank(this.jobExecEnv.getJobWorkingDir()))) {
    throw new GenieServerException("String_Node_Str");
  }
 else {
    this.jobWorkingDir=jobExecEnv.getJobWorkingDir();
  }
  genieLauncherScript=this.jobWorkingDir + "String_Node_Str" + GENIE_JOB_LAUNCHER_SCRIPT;
  makeDir(jobExecEnv.getJobWorkingDir());
  makeDir(jobExecEnv.getJobWorkingDir() + "String_Node_Str");
  makeDir(jobExecEnv.getJobWorkingDir() + "String_Node_Str");
  initializeWriter();
}

Fixed version (ground truth):
/** 
 * Constructor Initialize the object using Job execution environment object.
 * @param fileCopyServiceImpls List of implementations of the file copy interface
 * @param jobExecEnv           The job execution environment details like the job, cluster,command and applications
 * @param mode Whether to run it in full genie mode or just local.
 * @throws GenieException Exception in case of an error
 */
public JobExecutor(final List<FileCopyService> fileCopyServiceImpls,@NotNull(message="String_Node_Str") final JobExecutionEnvironment jobExecEnv,final String mode) throws GenieException {
  this.fileCopyServiceImpls=fileCopyServiceImpls;
  this.jobExecEnv=jobExecEnv;
  this.mode=mode;
  if (this.jobExecEnv.getJobWorkingDir() == null || StringUtils.isBlank(this.jobExecEnv.getJobWorkingDir())) {
    throw new GenieServerException("String_Node_Str");
  }
 else {
    this.jobWorkingDir=jobExecEnv.getJobWorkingDir();
  }
  genieLauncherScript=this.jobWorkingDir + "String_Node_Str" + GENIE_JOB_LAUNCHER_SCRIPT;
  makeDir(jobExecEnv.getJobWorkingDir());
  makeDir(jobExecEnv.getJobWorkingDir() + "String_Node_Str");
  makeDir(jobExecEnv.getJobWorkingDir() + "String_Node_Str");
  initializeWriter();
}
Program: 90084
Project: 90084
Buggy source:
/** 
 * Set the number of cpu's being requested to run the job. Defaults to 1 if not set.
 * @param cpu The number of cpu's. Must be > 0.
 * @return The builder
 */
public Builder withCpu(@Min(1) final int cpu){
  this.bCpu=cpu;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the number of cpu's being requested to run the job. Defaults to 1 if not set.
 * @param cpu The number of cpu's. Must be greater than 0.
 * @return The builder
 */
public Builder withCpu(@Min(1) final int cpu){
  this.bCpu=cpu;
  return this;
}
Program: 90085
Project: 90085
Buggy source:
/** 
 * Set the amount of memory being requested to run the job. Defaults to 1560 MB if not set.
 * @param memory The amount of memory in terms of MB's. Must be > 0.
 * @return The builder
 */
public Builder withMemory(@Min(1) final int memory){
  this.bMemory=memory;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the amount of memory being requested to run the job. Defaults to 1560 MB if not set.
 * @param memory The amount of memory in terms of MB's. Must be greater than 0.
 * @return The builder
 */
public Builder withMemory(@Min(1) final int memory){
  this.bMemory=memory;
  return this;
}
Program: 90087
Project: 90087
Buggy source:
/** 
 * Wait for job to complete, until the given timeout.
 * @param id           the Genie job ID to wait for completion
 * @param blockTimeout the time to block for (in ms), after which aGenieException will be thrown
 * @param pollTime     the time to sleep between polling for job status
 * @return the jobInfo for the job after completion
 * @throws GenieException       For any other error.
 * @throws InterruptedException on timeout/thread errors
 */
public Job waitForCompletion(final String id,final long blockTimeout,final long pollTime) throws GenieException, InterruptedException {
  if (StringUtils.isEmpty(id)) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  final long startTime=System.currentTimeMillis();
  while (true) {
    final Job job=getJob(id);
    if (!job.getFinished().equals(new Date(0))) {
      return job;
    }
    long currTime=System.currentTimeMillis();
    if (currTime - startTime < blockTimeout) {
      Thread.sleep(pollTime);
    }
 else {
      throw new InterruptedException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Wait for job to complete, until the given timeout.
 * @param id           the Genie job ID to wait for completion
 * @param blockTimeout the time to block for (in ms), after which aGenieException will be thrown
 * @param pollTime     the time to sleep between polling for job status
 * @return the jobInfo for the job after completion
 * @throws GenieException       For any other error.
 * @throws InterruptedException on timeout/thread errors
 */
public Job waitForCompletion(final String id,final long blockTimeout,final long pollTime) throws GenieException, InterruptedException {
  if (StringUtils.isEmpty(id)) {
    throw new GeniePreconditionException("String_Node_Str");
  }
  final long startTime=System.currentTimeMillis();
  while (true) {
    final Job job=getJob(id);
    final JobStatus status=job.getStatus();
    if (status == JobStatus.FAILED || status == JobStatus.KILLED || status == JobStatus.SUCCEEDED) {
      return job;
    }
    if (System.currentTimeMillis() - startTime < blockTimeout) {
      Thread.sleep(pollTime);
    }
 else {
      throw new InterruptedException("String_Node_Str");
    }
  }
}