nus-yam/ex-repair huggingface dataset:
Program: 59758
Project: 59758
Buggy source:
public void configureProcesses(RampartArgs args) throws IOException {
  this.args=args;
  RampartJobFileStructure jobFS=new RampartJobFileStructure(this.args.getOutputDir());
  String jobPrefix=createJobPrefix();
  QTArgs qtArgs=QTArgs.parseConfig(this.args.getConfig());
  qtArgs.setOutputDir(jobFS.getReadsDir());
  qtArgs.setJobPrefix(jobPrefix + "String_Node_Str");
  qtArgs.setCreateConfigs(true);
  qtArgs.setRunParallel(true);
  List<File> massConfigFiles=new ArrayList<File>();
  massConfigFiles.add(jobFS.getConfigRawFile());
  if (!qtArgs.isNoQT()) {
    massConfigFiles.add(jobFS.getConfigQtFile());
  }
  MultiMassArgs multiMassArgs=new MultiMassArgs();
  multiMassArgs.setConfigs(massConfigFiles);
  multiMassArgs.setOutputDir(jobFS.getMassDir());
  multiMassArgs.setJobPrefix(jobPrefix + "String_Node_Str");
  multiMassArgs.setRunParallel(true);
  AmpArgs ampArgs=AmpArgs.parseConfig(args.getConfig());
  ampArgs.setInputAssembly(jobFS.getMassOutFile());
  ampArgs.setJobPrefix(jobPrefix + "String_Node_Str");
  ampArgs.setOutputDir(jobFS.getImproverDir());
  List<RampartStage> stages=this.args.getStages();
  if (stages.contains(RampartStage.QT)) {
    this.processList.add(new QTProcess(qtArgs));
  }
  if (stages.contains(RampartStage.MASS)) {
    this.processList.add(new MultiMassProcess(multiMassArgs));
  }
  if (stages.contains(RampartStage.AMP)) {
    this.processList.add(new AmpProcess(ampArgs));
  }
  for (  AbstractConanProcess process : this.processList) {
    process.setConanProcessService(this.conanProcessService);
  }
}

Fixed version (ground truth):
public void configureProcesses(RampartArgs args) throws IOException {
  this.args=args;
  RampartJobFileStructure jobFS=new RampartJobFileStructure(this.args.getOutputDir());
  String jobPrefix=createJobPrefix();
  QTArgs qtArgs=QTArgs.parseConfig(this.args.getConfig());
  qtArgs.setOutputDir(jobFS.getReadsDir());
  qtArgs.setJobPrefix(jobPrefix + "String_Node_Str");
  qtArgs.setCreateConfigs(true);
  qtArgs.setRunParallel(true);
  List<File> massConfigFiles=new ArrayList<File>();
  massConfigFiles.add(jobFS.getConfigRawFile());
  if (!qtArgs.isNoQT()) {
    massConfigFiles.add(jobFS.getConfigQtFile());
  }
  MultiMassArgs multiMassArgs=new MultiMassArgs();
  multiMassArgs.parseConfig(this.args.getConfig());
  multiMassArgs.setConfigs(massConfigFiles);
  multiMassArgs.setOutputDir(jobFS.getMassDir());
  multiMassArgs.setJobPrefix(jobPrefix + "String_Node_Str");
  AmpArgs ampArgs=AmpArgs.parseConfig(args.getConfig());
  ampArgs.setInputAssembly(jobFS.getMassOutFile());
  ampArgs.setJobPrefix(jobPrefix + "String_Node_Str");
  ampArgs.setOutputDir(jobFS.getImproverDir());
  List<RampartStage> stages=this.args.getStages();
  if (stages.contains(RampartStage.QT)) {
    this.processList.add(new QTProcess(qtArgs));
  }
  if (stages.contains(RampartStage.MASS)) {
    this.processList.add(new MultiMassProcess(multiMassArgs));
  }
  if (stages.contains(RampartStage.AMP)) {
    this.processList.add(new AmpProcess(ampArgs));
  }
  for (  AbstractConanProcess process : this.processList) {
    process.setConanProcessService(this.conanProcessService);
  }
}
Program: 59759
Project: 59759
Buggy source:
@Override public void setFromArgMap(Map<ConanParameter,String> pvp){
  for (  Map.Entry<ConanParameter,String> entry : pvp.entrySet()) {
    if (!entry.getKey().validateParameterValue(entry.getValue())) {
      throw new IllegalArgumentException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
    }
    String param=entry.getKey().getName();
    if (param.equals(this.params.getInputDir().getName())) {
      this.inputDir=new File(entry.getValue());
    }
 else     if (param.equals(this.params.getOutputDir().getName())) {
      this.outputDir=new File(entry.getValue());
    }
 else     if (param.equals(this.params.getStage().getName())) {
      this.rampartStage=RampartStage.valueOf(entry.getValue());
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + param);
    }
  }
}

Fixed version (ground truth):
@Override public void setFromArgMap(Map<ConanParameter,String> pvp){
  for (  Map.Entry<ConanParameter,String> entry : pvp.entrySet()) {
    if (!entry.getKey().validateParameterValue(entry.getValue())) {
      throw new IllegalArgumentException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
    }
    String param=entry.getKey().getName();
    if (param.equals(this.params.getInputDir().getName())) {
      this.inputDir=new File(entry.getValue());
    }
 else     if (param.equals(this.params.getOutputDir().getName())) {
      this.outputDir=new File(entry.getValue());
    }
 else     if (param.equals(this.params.getStage().getName())) {
      this.rampartStage=RampartStage.valueOf(entry.getValue());
    }
 else     if (param.equals(this.params.getDataset().getName())) {
      this.dataset=entry.getValue();
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + param);
    }
  }
}
Program: 59760
Project: 59760
Buggy source:
public LengthAnalysisArgs(){
  this.inputDir=null;
  this.outputDir=null;
  this.rampartStage=RampartStage.MASS;
}

Fixed version (ground truth):
public LengthAnalysisArgs(){
  this.inputDir=null;
  this.outputDir=null;
  this.rampartStage=RampartStage.MASS;
  this.dataset=null;
}
Program: 59761
Project: 59761
Buggy source:
@Override public Map<ConanParameter,String> getArgMap(){
  Map<ConanParameter,String> pvp=new HashMap<ConanParameter,String>();
  if (this.inputDir != null)   pvp.put(params.getInputDir(),this.inputDir.getAbsolutePath());
  if (this.outputDir != null)   pvp.put(params.getOutputDir(),this.outputDir.getAbsolutePath());
  pvp.put(params.getStage(),this.rampartStage.toString());
  return pvp;
}

Fixed version (ground truth):
@Override public Map<ConanParameter,String> getArgMap(){
  Map<ConanParameter,String> pvp=new HashMap<ConanParameter,String>();
  if (this.inputDir != null) {
    pvp.put(params.getInputDir(),this.inputDir.getAbsolutePath());
  }
  if (this.outputDir != null) {
    pvp.put(params.getOutputDir(),this.outputDir.getAbsolutePath());
  }
  if (this.rampartStage != null) {
    pvp.put(params.getStage(),this.rampartStage.toString());
  }
  if (this.dataset != null && !this.dataset.isEmpty()) {
    pvp.put(params.getDataset(),this.rampartStage.toString());
  }
  return pvp;
}
Program: 59762
Project: 59762
Buggy source:
@Override public List<ConanParameter> getConanParameters(){
  return new ArrayList<ConanParameter>(Arrays.asList(new ConanParameter[]{this.inputDir,this.outputDir,this.stage}));
}

Fixed version (ground truth):
@Override public List<ConanParameter> getConanParameters(){
  return new ArrayList<ConanParameter>(Arrays.asList(new ConanParameter[]{this.inputDir,this.outputDir,this.stage,this.dataset}));
}
Program: 59763
Project: 59763
Buggy source:
public LengthAnalysisParams(){
  this.inputDir=new PathParameter("String_Node_Str","String_Node_Str",true);
  this.outputDir=new PathParameter("String_Node_Str","String_Node_Str",true);
  this.stage=new DefaultConanParameter("String_Node_Str","String_Node_Str",false,true,false);
}

Fixed version (ground truth):
public LengthAnalysisParams(){
  this.inputDir=new PathParameter("String_Node_Str","String_Node_Str",true);
  this.outputDir=new PathParameter("String_Node_Str","String_Node_Str",true);
  this.stage=new DefaultConanParameter("String_Node_Str","String_Node_Str",false,true,false);
  this.dataset=new DefaultConanParameter("String_Node_Str","String_Node_Str",false,true,false);
}
Program: 59764
Project: 59764
Buggy source:
@Override public boolean execute(ExecutionContext env) throws ProcessExecutionException, InterruptedException {
  LengthAnalysisArgs args=(LengthAnalysisArgs)this.getProcessArgs();
  File[] assemblyFiles=args.getInputDir().listFiles(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str");
    }
  }
);
  Arrays.sort(assemblyFiles);
  log.debug("String_Node_Str" + StringUtils.join(assemblyFiles,"String_Node_Str"));
  try {
    Map<String,AssemblyStats> statsMap=new LinkedHashMap<String,AssemblyStats>();
    for (    File assemblyFile : assemblyFiles) {
      String key=args.getRampartStage().translateFilenameToKey(assemblyFile.getName());
      AssemblyStats stats=this.sequenceStatisticsService.analyseAssembly(assemblyFile);
      statsMap.put(key,stats);
    }
    File statsFile=new File(args.getOutputDir(),"String_Node_Str");
    writeStatistics(statsFile,statsMap,args.getRampartStage());
    plot(args.getOutputDir(),statsFile,env);
  }
 catch (  IOException ioe) {
    throw new ProcessExecutionException(-1,ioe);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean execute(ExecutionContext env) throws ProcessExecutionException, InterruptedException {
  LengthAnalysisArgs args=(LengthAnalysisArgs)this.getProcessArgs();
  File[] assemblyFiles=args.getInputDir().listFiles(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str");
    }
  }
);
  Arrays.sort(assemblyFiles);
  log.debug("String_Node_Str" + StringUtils.join(assemblyFiles,"String_Node_Str"));
  try {
    Map<String,AssemblyStats> statsMap=new LinkedHashMap<String,AssemblyStats>();
    for (    File assemblyFile : assemblyFiles) {
      String key=args.getRampartStage().translateFilenameToKey(assemblyFile.getName());
      AssemblyStats stats=this.sequenceStatisticsService.analyseAssembly(assemblyFile);
      if (stats != null) {
        if (args.getRampartStage() != null) {
          stats.setDesc(args.getRampartStage().toString());
        }
        stats.setDataset(args.getDataset());
        stats.setFilePath(assemblyFile.getAbsolutePath());
      }
      statsMap.put(key,stats);
    }
    File statsFile=new File(args.getOutputDir(),"String_Node_Str");
    writeStatistics(statsFile,statsMap,args.getRampartStage());
    plot(args.getOutputDir(),statsFile,env);
  }
 catch (  IOException ioe) {
    throw new ProcessExecutionException(-1,ioe);
  }
  return true;
}
Program: 59765
Project: 59765
Buggy source:
@Override public Map<ConanParameter,String> getArgMap(){
  Map<ConanParameter,String> pvp=new HashMap<ConanParameter,String>();
  if (this.assembler != null)   pvp.put(params.getAssembler(),this.assembler);
  pvp.put(params.getKmin(),String.valueOf(this.kmin));
  pvp.put(params.getKmax(),String.valueOf(this.kmax));
  pvp.put(params.getThreads(),String.valueOf(this.threads));
  pvp.put(params.getMemory(),String.valueOf(this.memory));
  pvp.put(params.getStepSize(),this.stepSize.toString());
  pvp.put(params.getRunParallel(),Boolean.toString(this.runParallel));
  if (this.libs != null && this.libs.size() > 0)   pvp.put(params.getLibs(),this.libs.toString());
  if (this.outputDir != null)   pvp.put(params.getOutputDir(),this.outputDir.getAbsolutePath());
  if (this.jobPrefix != null)   pvp.put(params.getJobPrefix(),this.jobPrefix);
  return pvp;
}

Fixed version (ground truth):
@Override public Map<ConanParameter,String> getArgMap(){
  Map<ConanParameter,String> pvp=new HashMap<ConanParameter,String>();
  if (this.assembler != null)   pvp.put(params.getAssembler(),this.assembler);
  pvp.put(params.getKmin(),String.valueOf(this.kmin));
  pvp.put(params.getKmax(),String.valueOf(this.kmax));
  pvp.put(params.getThreads(),String.valueOf(this.threads));
  pvp.put(params.getMemory(),String.valueOf(this.memory));
  if (this.stepSize != null)   pvp.put(params.getStepSize(),this.stepSize.toString());
  if (this.parallelismLevel != null)   pvp.put(params.getParallelismLevel(),this.parallelismLevel.toString());
  if (this.libs != null && this.libs.size() > 0)   pvp.put(params.getLibs(),this.libs.toString());
  if (this.outputDir != null)   pvp.put(params.getOutputDir(),this.outputDir.getAbsolutePath());
  if (this.jobPrefix != null)   pvp.put(params.getJobPrefix(),this.jobPrefix);
  return pvp;
}
Program: 59766
Project: 59766
Buggy source:
public MassArgs(){
  this.assembler=null;
  this.kmin=DEFAULT_KMER_MIN;
  this.kmax=DEFAULT_KMER_MAX;
  this.stepSize=DEFAULT_STEP_SIZE;
  this.libs=new ArrayList<Library>();
  this.jobPrefix="String_Node_Str";
  this.outputDir=null;
  this.threads=DEFAULT_THREADS;
  this.memory=DEFAULT_MEM;
}

Fixed version (ground truth):
public MassArgs(){
  this.assembler=null;
  this.kmin=DEFAULT_KMER_MIN;
  this.kmax=DEFAULT_KMER_MAX;
  this.stepSize=DEFAULT_STEP_SIZE;
  this.libs=new ArrayList<Library>();
  this.jobPrefix="String_Node_Str";
  this.outputDir=null;
  this.threads=DEFAULT_THREADS;
  this.memory=DEFAULT_MEM;
  this.parallelismLevel=DEFAULT_PARALLELISM_LEVEL;
}
Program: 59767
Project: 59767
Buggy source:
@Override public void setFromArgMap(Map<ConanParameter,String> pvp){
  for (  Map.Entry<ConanParameter,String> entry : pvp.entrySet()) {
    if (!entry.getKey().validateParameterValue(entry.getValue())) {
      throw new IllegalArgumentException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
    }
    String param=entry.getKey().getName();
    if (param.equals(this.params.getAssembler().getName())) {
      this.assembler=entry.getValue();
    }
 else     if (param.equals(this.params.getKmin().getName())) {
      this.kmin=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getKmax().getName())) {
      this.kmax=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getThreads().getName())) {
      this.threads=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getMemory().getName())) {
      this.memory=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getStepSize().getName())) {
      this.stepSize=StepSize.valueOf(entry.getValue());
    }
 else     if (param.equals(this.params.getLibs().getName())) {
      this.libs=new ArrayList<Library>();
    }
 else     if (param.equals(this.params.getJobPrefix().getName())) {
      this.jobPrefix=entry.getValue();
    }
 else     if (param.equals(this.params.getOutputDir().getName())) {
      this.outputDir=new File(entry.getValue());
    }
  }
}

Fixed version (ground truth):
@Override public void setFromArgMap(Map<ConanParameter,String> pvp){
  for (  Map.Entry<ConanParameter,String> entry : pvp.entrySet()) {
    if (!entry.getKey().validateParameterValue(entry.getValue())) {
      throw new IllegalArgumentException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue());
    }
    String param=entry.getKey().getName();
    if (param.equals(this.params.getAssembler().getName())) {
      this.assembler=entry.getValue();
    }
 else     if (param.equals(this.params.getKmin().getName())) {
      this.kmin=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getKmax().getName())) {
      this.kmax=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getThreads().getName())) {
      this.threads=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getMemory().getName())) {
      this.memory=Integer.parseInt(entry.getValue());
    }
 else     if (param.equals(this.params.getStepSize().getName())) {
      this.stepSize=StepSize.valueOf(entry.getValue());
    }
 else     if (param.equals(this.params.getLibs().getName())) {
      this.libs=new ArrayList<Library>();
    }
 else     if (param.equals(this.params.getJobPrefix().getName())) {
      this.jobPrefix=entry.getValue();
    }
 else     if (param.equals(this.params.getOutputDir().getName())) {
      this.outputDir=new File(entry.getValue());
    }
 else     if (param.equalsIgnoreCase(this.params.getParallelismLevel().getName())) {
      this.parallelismLevel=ParallelismLevel.valueOf(entry.getValue());
    }
  }
}
Program: 59768
Project: 59768
Buggy source:
@Override public int executeCommand(String command,Scheduler scheduler) throws ProcessExecutionException, InterruptedException {
  if (scheduler == null) {
    return -1;
  }
 else {
    return scheduler.executeCommand(command);
  }
}

Fixed version (ground truth):
@Override public int executeCommand(String command,Scheduler scheduler) throws ProcessExecutionException, InterruptedException {
  String[] output=null;
  if (scheduler == null) {
    try {
      output=this.nativeProcessExecutor.execute(command);
    }
 catch (    IOException ioe) {
      throw new ProcessExecutionException(-1,ioe);
    }
catch (    CommandExecutionException cee) {
      throw new ProcessExecutionException(-1,cee);
    }
  }
 else {
    output=scheduler.executeCommand(command);
  }
  return output == null ? -1 : 0;
}
Program: 59769
Project: 59769
Buggy source:
@Override public int executeCommand(String command,Scheduler scheduler) throws ProcessExecutionException, InterruptedException {
  String commandToExecute=scheduler.createCommand(command);
  int exitValue=-1;
  try {
    Channel channel=this.session.openChannel("String_Node_Str");
    ((ChannelExec)channel).setCommand(commandToExecute);
    channel.connect();
    String output=readProcessOutput(channel);
    channel.disconnect();
    log.info("String_Node_Str" + commandToExecute + "String_Node_Str"+ session.getHost());
    exitValue=0;
  }
 catch (  JSchException je) {
    log.error("String_Node_Str");
    throw new ProcessExecutionException(exitValue,je);
  }
catch (  IOException ioe) {
    log.error("String_Node_Str");
    throw new ProcessExecutionException(exitValue,ioe);
  }
  return exitValue;
}

Fixed version (ground truth):
@Override public int executeCommand(String command,Scheduler scheduler) throws ProcessExecutionException, InterruptedException {
  String commandToExecute=scheduler != null ? scheduler.createCommand(command) : command;
  int exitValue=-1;
  try {
    Channel channel=this.session.openChannel("String_Node_Str");
    ((ChannelExec)channel).setCommand(commandToExecute);
    channel.connect();
    String output=readProcessOutput(channel);
    channel.disconnect();
    log.info("String_Node_Str" + commandToExecute + "String_Node_Str"+ session.getHost());
    exitValue=0;
  }
 catch (  JSchException je) {
    log.error("String_Node_Str");
    throw new ProcessExecutionException(exitValue,je);
  }
catch (  IOException ioe) {
    log.error("String_Node_Str");
    throw new ProcessExecutionException(exitValue,ioe);
  }
  return exitValue;
}
Program: 59770
Project: 59770
Buggy source:
/** 
 * Dispatches command and then forgets about it.  No progress tracking is performed.
 * @param command The command to dispatch to the scheduler
 * @throws ProcessExecutionException
 */
@Override public void dispatchCommand(String command) throws IllegalArgumentException, ProcessExecutionException, InterruptedException {
  String schedulerCommand=this.createCommand(command);
  boolean dispatched=false;
  try {
    log.debug("String_Node_Str" + schedulerCommand);
    String[] output=this.nativeProcessExecutor.execute(schedulerCommand);
  }
 catch (  CommandExecutionException e) {
    String message="String_Node_Str" + e.getExitCode() + "String_Node_Str";
    log.error(message,e);
    ProcessExecutionException pex=new ProcessExecutionException(e.getExitCode(),message,e);
    pex.setProcessOutput(e.getErrorOutput());
    try {
      pex.setProcessExecutionHost(InetAddress.getLocalHost().getHostName());
    }
 catch (    UnknownHostException e1) {
      log.debug("String_Node_Str",e1);
    }
    throw pex;
  }
catch (  IOException e) {
    String message="String_Node_Str";
    log.error(message);
    log.debug("String_Node_Str",e);
    throw new ProcessExecutionException(1,message,e);
  }
}

Fixed version (ground truth):
/** 
 * Dispatches command and then forgets about it.  No progress tracking is performed.
 * @param command The command to dispatch to the scheduler
 * @throws ProcessExecutionException
 */
@Override public String[] dispatchCommand(String command) throws IllegalArgumentException, ProcessExecutionException, InterruptedException {
  String schedulerCommand=this.createCommand(command);
  String[] output=null;
  boolean dispatched=false;
  try {
    log.debug("String_Node_Str" + schedulerCommand);
    output=this.nativeProcessExecutor.execute(schedulerCommand);
  }
 catch (  CommandExecutionException e) {
    String message="String_Node_Str" + e.getExitCode() + "String_Node_Str";
    log.error(message,e);
    ProcessExecutionException pex=new ProcessExecutionException(e.getExitCode(),message,e);
    pex.setProcessOutput(e.getErrorOutput());
    try {
      pex.setProcessExecutionHost(InetAddress.getLocalHost().getHostName());
    }
 catch (    UnknownHostException e1) {
      log.debug("String_Node_Str",e1);
    }
    throw pex;
  }
catch (  IOException e) {
    String message="String_Node_Str";
    log.error(message);
    log.debug("String_Node_Str",e);
    throw new ProcessExecutionException(1,message,e);
  }
  return output;
}
Program: 59772
Project: 59772
Buggy source:
@Override public int executeCommand(String command) throws IllegalArgumentException, ProcessExecutionException, InterruptedException {
  int exitValue=-1;
  if (!this.getArgs().isBackgroundTask()) {
    this.monitoredDispatch(command);
    exitValue=this.waitFor(this.createProcessAdapter());
  }
 else {
    this.dispatchCommand(command);
    exitValue=0;
  }
  return exitValue;
}

Fixed version (ground truth):
@Override public String[] executeCommand(String command) throws IllegalArgumentException, ProcessExecutionException, InterruptedException {
  String[] output=null;
  if (!this.getArgs().isBackgroundTask()) {
    output=this.monitoredDispatch(command);
    this.waitFor(this.createProcessAdapter());
  }
 else {
    output=this.dispatchCommand(command);
  }
  return output;
}
Program: 59773
Project: 59773
Buggy source:
@Override public int executeWaitCommand(WaitCondition waitCondition) throws InterruptedException, ProcessExecutionException {
  String waitCommand=this.createWaitCommand(waitCondition);
  return this.executeCommand(waitCommand);
}

Fixed version (ground truth):
@Override public String[] executeWaitCommand(WaitCondition waitCondition) throws InterruptedException, ProcessExecutionException {
  String waitCommand=this.createWaitCommand(waitCondition);
  return this.executeCommand(waitCommand);
}
Program: 59774
Project: 59774
Buggy source:
/** 
 * Executes the provided command on this architecture in the background
 * @param command The command to execute
 * @return the exit code returned from the executed process
 * @throws ProcessExecutionException
 * @throws InterruptedException
 */
void dispatchCommand(String command) throws ProcessExecutionException, InterruptedException ;

Fixed version (ground truth):
/** 
 * Executes the provided command on this architecture in the background
 * @param command The command to execute
 * @return the output returned from the executed process
 * @throws ProcessExecutionException
 * @throws InterruptedException
 */
String[] dispatchCommand(String command) throws ProcessExecutionException, InterruptedException ;
Program: 59775
Project: 59775
Buggy source:
/** 
 * Executes the provided command on this architecture in the foreground
 * @param command The command to execute
 * @return the exit code returned from the executed process
 * @throws ProcessExecutionException
 * @throws InterruptedException
 */
int executeCommand(String command) throws ProcessExecutionException, InterruptedException ;

Fixed version (ground truth):
/** 
 * Executes the provided command on this architecture in the foreground
 * @param command The command to execute
 * @return the output returned from the executed process
 * @throws ProcessExecutionException
 * @throws InterruptedException
 */
String[] executeCommand(String command) throws ProcessExecutionException, InterruptedException ;
Program: 59776
Project: 59776
Buggy source:
/** 
 * Wait for the specified wait condition to be satisifed
 * @param waitCondition The wait condition
 * @return The exit code return by the process that was waited for.
 * @throws InterruptedException
 * @throws ProcessExecutionException
 */
int executeWaitCommand(WaitCondition waitCondition) throws InterruptedException, ProcessExecutionException ;

Fixed version (ground truth):
/** 
 * Wait for the specified wait condition to be satisifed
 * @param waitCondition The wait condition
 * @return The output returned by the process that was waited for.
 * @throws InterruptedException
 * @throws ProcessExecutionException
 */
String[] executeWaitCommand(WaitCondition waitCondition) throws InterruptedException, ProcessExecutionException ;
Program: 59777
Project: 59777
Buggy source:
@Override public int executeCommand(String command) throws IllegalArgumentException, ProcessExecutionException, InterruptedException {
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String[] executeCommand(String command) throws IllegalArgumentException, ProcessExecutionException, InterruptedException {
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 59778
Project: 59778
Buggy source:
/** 
 * Called whenever an error occurs in monitoring this process (for example, if the output file being monitored is deleted by an external process).
 * @param evt an event reporting the change to the file
 */
void processError(ProcessEvent evt);

Fixed version (ground truth):
/** 
 * Called whenever an error occurs in monitoring this process (for example, if the output file being monitored is deleted by an process process).
 * @param evt an event reporting the change to the file
 */
void processError(ProcessEvent evt);
Program: 59779
Project: 59779
Buggy source:
/** 
 * Helper that loads config settings and throws exceptions if something is amiss.
 * @throws IllegalArgumentException if a config value is invalid
 * @throws NumberFormatException if a config value is invalid
 */
private void setConfiguration(){
  final String host_config=config.getString("String_Node_Str");
  if (host_config == null || host_config.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  setHosts(host_config);
  index_threads=config.getInt("String_Node_Str");
  tsmeta_type=config.getString("String_Node_Str");
  if (tsmeta_type == null || tsmeta_type.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  index=config.getString("String_Node_Str");
  if (index == null || index.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  uidmeta_type=config.getString("String_Node_Str");
  if (uidmeta_type == null || uidmeta_type.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Helper that loads config settings and throws exceptions if something is amiss.
 * @throws IllegalArgumentException if a config value is invalid
 * @throws NumberFormatException if a config value is invalid
 */
private void setConfiguration(){
  final String host_config=config.getString("String_Node_Str");
  if (host_config == null || host_config.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  setHosts(host_config);
  index_threads=config.getInt("String_Node_Str");
  index=config.getString("String_Node_Str");
  if (index == null || index.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  tsmeta_type=config.getString("String_Node_Str");
  if (tsmeta_type == null || tsmeta_type.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  uidmeta_type=config.getString("String_Node_Str");
  if (uidmeta_type == null || uidmeta_type.isEmpty()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 59780
Project: 59780
Buggy source:
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String l=fmt.formatTermAs(args.get(0),boolean.class);
  final String inlined;
  if (stmtsOkay) {
    final String r=InlinerUtils.formatBlockStmts(fmt,args.get(1));
    inlined="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
  }
 else {
    final String r=InlinerUtils.formatBlockExpr(fmt,args.get(1));
    final String expr="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
    inlined=fmt.fixup(apply.getLoc(),expr,boolean.class);
  }
  return inlined;
}

Fixed version (ground truth):
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String l=fmt.formatTermAs(args.get(0),boolean.class);
  final String inlined;
  if (stmtsOkay) {
    final String r=InlinerUtils.formatBlockStmts(fmt,args.get(1),true);
    if (r == null)     return null;
    inlined="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
  }
 else {
    final String r=InlinerUtils.formatBlockExpr(fmt,args.get(1),true);
    if (r == null)     return null;
    final String expr="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
    inlined=fmt.fixup(apply.getLoc(),expr,boolean.class);
  }
  return inlined;
}
Program: 59782
Project: 59782
Buggy source:
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final Type applyType=apply.getType();
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String c=fmt.formatTermAs(args.get(0),boolean.class);
  final String def=fmt.formatTermAs(args.get(1),applyType);
  final String inlined;
  if (stmtsOkay) {
    final String block=InlinerUtils.formatBlockStmts(fmt,args.get(2));
    inlined="String_Node_Str" + c + "String_Node_Str"+ def+ "String_Node_Str"+ block+ "String_Node_Str";
  }
 else {
    final String block=InlinerUtils.formatBlockExpr(fmt,args.get(2));
    final String expr="String_Node_Str" + c + "String_Node_Str"+ def+ "String_Node_Str"+ block+ "String_Node_Str";
    inlined=fmt.fixup(apply.getLoc(),expr,applyType);
  }
  return inlined;
}

Fixed version (ground truth):
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final Type applyType=apply.getType();
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String c=fmt.formatTermAs(args.get(0),boolean.class);
  final String def=fmt.formatTermAs(args.get(1),applyType);
  final String inlined;
  if (stmtsOkay) {
    final String block=InlinerUtils.formatBlockStmts(fmt,args.get(2),true);
    if (block == null)     return null;
    inlined="String_Node_Str" + c + "String_Node_Str"+ def+ "String_Node_Str"+ block+ "String_Node_Str";
  }
 else {
    final String block=InlinerUtils.formatBlockExpr(fmt,args.get(2),true);
    if (block == null)     return null;
    final String expr="String_Node_Str" + c + "String_Node_Str"+ def+ "String_Node_Str"+ block+ "String_Node_Str";
    inlined=fmt.fixup(apply.getLoc(),expr,applyType);
  }
  return inlined;
}
Program: 59783
Project: 59783
Buggy source:
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String c=fmt.formatTermAs(args.get(0),boolean.class);
  final String inlined;
  if (stmtsOkay) {
    final String t=InlinerUtils.formatBlockStmts(fmt,args.get(1));
    final String f=InlinerUtils.formatBlockStmts(fmt,args.get(2));
    inlined="String_Node_Str" + c + "String_Node_Str"+ t+ "String_Node_Str"+ f+ "String_Node_Str";
  }
 else {
    final String t=InlinerUtils.formatBlockExpr(fmt,args.get(1));
    final String f=InlinerUtils.formatBlockExpr(fmt,args.get(2));
    final String expr="String_Node_Str" + c + "String_Node_Str"+ t+ "String_Node_Str"+ f+ "String_Node_Str";
    final Type applyType=apply.getType();
    inlined=fmt.fixup(apply.getLoc(),expr,applyType);
  }
  return inlined;
}

Fixed version (ground truth):
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String c=fmt.formatTermAs(args.get(0),boolean.class);
  final String inlined;
  if (stmtsOkay) {
    final String t=InlinerUtils.formatBlockStmts(fmt,args.get(1),true);
    if (t == null)     return null;
    final String f=InlinerUtils.formatBlockStmts(fmt,args.get(2),true);
    if (f == null)     return null;
    inlined="String_Node_Str" + c + "String_Node_Str"+ t+ "String_Node_Str"+ f+ "String_Node_Str";
  }
 else {
    final String t=InlinerUtils.formatBlockExpr(fmt,args.get(1),true);
    if (t == null)     return null;
    final String f=InlinerUtils.formatBlockExpr(fmt,args.get(2),true);
    if (f == null)     return null;
    final String expr="String_Node_Str" + c + "String_Node_Str"+ t+ "String_Node_Str"+ f+ "String_Node_Str";
    final Type applyType=apply.getType();
    inlined=fmt.fixup(apply.getLoc(),expr,applyType);
  }
  return inlined;
}
Program: 59785
Project: 59785
Buggy source:
/** 
 * Try to inline the body of a block, in an expression context. If successful, a string containing the generated code is returned, otherwise null. See   {@link #formatBlockStmts(compile.gen.java.StatementFormatter,compile.term.Term,boolean)}for general details. An important difference here is that the expression (rather than statement) context prevents us from generating code containing multiple statements.
 */
static String formatBlockExpr(final StatementFormatter fmt,final Term block,final boolean fallbackToCall){
  final Loc loc=block.getLoc();
  final Type type=block.getType();
  final Type resultType=Types.funResult(type);
  final Term body=new ApplyTerm(loc,block,TupleTerm.UNIT);
  body.setType(resultType);
  final String call;
  if (fallbackToCall) {
    call=fmt.formatTermAs(body,resultType);
  }
 else {
    fmt.formatTermAs(body,resultType);
    call=null;
  }
  final LambdaTerm blockDeref=derefToLambda(block);
  if (blockDeref == null)   return call;
  if (blockDeref.getNonResultStatements().isEmpty()) {
    final boolean save=fmt.getInExpr();
    fmt.setInExpr(true);
    final Term resultTerm=blockDeref.getResultStatement().getValue();
    final String bodyFmt=fmt.formatTermAs(resultTerm,resultType);
    fmt.setInExpr(save);
    return bodyFmt;
  }
  return call;
}

Fixed version (ground truth):
/** 
 * Try to inline the body of a block, in an expression context. If successful, a string containing the generated code is returned, otherwise null. First criterion for success concerns the term itself, as described in   {@link #formatBlockStmts}. In an expression context, we also require that the body of a successfully dereferenced block consist of a single expression in generated code.
 */
static String formatBlockExpr(final StatementFormatter fmt,final Term block,final boolean fallbackToCall){
  final Loc loc=block.getLoc();
  final Type type=block.getType();
  final Type resultType=Types.funResult(type);
  final Term body=new ApplyTerm(loc,block,TupleTerm.UNIT);
  body.setType(resultType);
  final String call;
{
    if (fallbackToCall && isImmediate(block)) {
      call=fmt.formatTermAs(body,resultType);
    }
 else {
      fmt.formatTermAs(body,resultType);
      call=null;
    }
  }
  final LambdaTerm blockDeref=derefToLambda(block);
  if (blockDeref == null)   return call;
  if (!blockDeref.getNonResultStatements().isEmpty())   return call;
  final boolean save=fmt.getInExpr();
  fmt.setInExpr(true);
  final Term resultTerm=blockDeref.getResultStatement().getValue();
  final String bodyFmt=fmt.formatTermAs(resultTerm,resultType);
  fmt.setInExpr(save);
  return bodyFmt;
}
Program: 59786
Project: 59786
Buggy source:
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String l=fmt.formatTermAs(args.get(0),boolean.class);
  final String inlined;
  if (stmtsOkay) {
    final String r=InlinerUtils.formatBlockStmts(fmt,args.get(1));
    inlined="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
  }
 else {
    final String r=InlinerUtils.formatBlockExpr(fmt,args.get(1));
    final String expr="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
    inlined=fmt.fixup(apply.getLoc(),expr,boolean.class);
  }
  return inlined;
}

Fixed version (ground truth):
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String l=fmt.formatTermAs(args.get(0),boolean.class);
  final String inlined;
  if (stmtsOkay) {
    final String r=InlinerUtils.formatBlockStmts(fmt,args.get(1),true);
    if (r == null)     return null;
    inlined="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
  }
 else {
    final String r=InlinerUtils.formatBlockExpr(fmt,args.get(1),true);
    if (r == null)     return null;
    final String expr="String_Node_Str" + l + "String_Node_Str"+ r+ "String_Node_Str";
    inlined=fmt.fixup(apply.getLoc(),expr,boolean.class);
  }
  return inlined;
}
Program: 59787
Project: 59787
Buggy source:
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  if (!stmtsOkay)   return null;
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String c=fmt.formatTermAs(args.get(0),boolean.class);
  final String ufmt=fmt.formatTermAs(TupleTerm.UNIT,Types.unit());
  final String block=InlinerUtils.formatBlockStmts(fmt,args.get(1));
  return "String_Node_Str" + c + "String_Node_Str"+ block+ "String_Node_Str";
}

Fixed version (ground truth):
public String tryInlining(final ApplyTerm apply,final StatementFormatter fmt,final boolean stmtsOkay){
  if (!stmtsOkay)   return null;
  final List<Term> args=((TupleTerm)apply.getArg()).getItems();
  final String c=fmt.formatTermAs(args.get(0),boolean.class);
  final String block=InlinerUtils.formatBlockStmts(fmt,args.get(1),true);
  if (block == null)   return null;
  return "String_Node_Str" + c + "String_Node_Str"+ block+ "String_Node_Str";
}
Program: 59788
Project: 59788
Buggy source:
/** 
 * Shutdowns reporting task thread and waits for the reporting tasks to be finished.
 */
private void waitForReportingTasks(){
  if (runInfo.getDuration().getPeriodType() == PeriodType.TIME) {
    long lastTasks=0;
    long tasks=getTasksInQueue();
    reportingTasks.shutdown();
    while (tasks > 0 && tasks != lastTasks) {
      lastTasks=tasks;
      try {
        reportingTasks.awaitTermination(1,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ie) {
      }
      tasks=getTasksInQueue();
    }
    reportingTasks=null;
  }
 else {
    while (getTasksInQueue() > 0 || (periodicThread != null && periodicThread.isAlive())) {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException ie) {
      }
    }
    reportingTasks.shutdown();
    reportingTasks=null;
  }
}

Fixed version (ground truth):
/** 
 * Shutdowns reporting task thread and waits for the reporting tasks to be finished.
 */
private void waitForReportingTasks(){
  if (runInfo.getDuration().getPeriodType() == PeriodType.TIME) {
    long lastTasks=0;
    long tasks=getTasksInQueue();
    reportingTasks.shutdown();
    while (tasks > 0 && tasks != lastTasks) {
      lastTasks=tasks;
      try {
        reportingTasks.awaitTermination(1,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ie) {
      }
      tasks=getTasksInQueue();
    }
    reportingTasks=null;
  }
 else {
    int deadLine=5;
    while (deadLine > 0 && (getTasksInQueue() > 0 || (periodicThread != null && periodicThread.isAlive()))) {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException ie) {
      }
      deadLine--;
    }
    reportingTasks.shutdown();
    reportingTasks=null;
  }
}
Program: 59789
Project: 59789
Buggy source:
/** 
 * Performs a garbage collection based on the provided time information. This might be useful when controlling the time artificially.
 * @param time Current artificial time.
 */
public void gc(final long time){
  Iterator<TemporalObject<E>> it=window.iterator();
  while (it.hasNext() && it.next().time < time - length) {
    it.remove();
  }
}

Fixed version (ground truth):
/** 
 * Performs a garbage collection based on the provided time information. This might be useful when controlling the time artificially.
 * @param time Current artificial time.
 */
public void gc(final long time){
  CursorableLinkedList.Cursor<TemporalObject<E>> it=window.cursor();
  while (it.hasNext() && it.next().time < time - length) {
    it.remove();
  }
}
Program: 59790
Project: 59790
Buggy source:
/** 
 * Prints trace information for test debugging purposes.
 */
private void printTraceInformation(){
  if (log.isTraceEnabled()) {
    log.trace("String_Node_Str");
    final List<String> p=System.getProperties().entrySet().stream().map(entry -> "String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue()).collect(Collectors.toCollection(() -> new LinkedList<>()));
    Collections.sort(p);
    for (    final String s : p) {
      log.trace(s);
    }
    log.trace("String_Node_Str");
    final ClassLoader currentCL=ScenarioExecution.class.getClassLoader();
    final URL[] curls=((URLClassLoader)currentCL).getURLs();
    for (    final URL curl : curls) {
      log.trace("String_Node_Str" + curl);
    }
  }
}

Fixed version (ground truth):
/** 
 * Prints trace information for test debugging purposes.
 */
private void printTraceInformation(){
  if (log.isTraceEnabled()) {
    log.trace("String_Node_Str");
    final List<String> p=System.getProperties().entrySet().stream().map(entry -> "String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue()).collect(Collectors.toCollection(() -> new LinkedList<>()));
    Collections.sort(p);
    for (    final String s : p) {
      log.trace(s);
    }
    log.trace("String_Node_Str");
    final ClassLoader currentClassLoader=ScenarioExecution.class.getClassLoader();
    final URL[] curls=((URLClassLoader)currentClassLoader).getURLs();
    for (    final URL curl : curls) {
      log.trace("String_Node_Str" + curl);
    }
  }
}
Program: 59791
Project: 59791
Buggy source:
/** 
 * Performs the given action for each element of the sliding window until all elements have been processed or the action throws an exception. Only the elements in the valid time window are processed. All older elements are garbage collected. This action might not return all elements when 1) it was already called with a higher (later) current time, 2)   {@link #forEach(Consumer)}was already called which actually propagated a higher (later) time to this method.
 * @param currentTime Artificial time to control the position of the sliding window.
 * @param action The action to be performed for each element.
 */
public void forEach(final long currentTime,final Consumer<E> action){
  gc(currentTime);
  for (  final TemporalObject<E> te : window) {
    if (te.time <= currentTime) {
      action.accept(te.object);
    }
 else {
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * <p>Performs the given action for each element of the sliding window until all elements have been processed or the action throws an exception.</p> <p>Only the elements in the valid time window are processed. All older elements are garbage collected.</p> <p>This action might not return all elements when 1) it was already called with a higher (later) current time, 2)   {@link #forEach(Consumer)}was already called which actually propagated a higher (later) time to this method.</p>
 * @param currentTime Artificial time to control the position of the sliding window.
 * @param action The action to be performed for each element.
 */
public void forEach(final long currentTime,final Consumer<E> action){
  gc(currentTime);
  for (  final TemporalObject<E> te : window) {
    if (te.time <= currentTime) {
      action.accept(te.object);
    }
 else {
      break;
    }
  }
}
Program: 59792
Project: 59792
Buggy source:
abstract public void doClose() throws PerfCakeException ;

Fixed version (ground truth):
public abstract void doClose() throws PerfCakeException ;
Program: 59793
Project: 59793
Buggy source:
abstract public void doInit(final Properties messageAttributes) throws PerfCakeException ;

Fixed version (ground truth):
public abstract void doInit(final Properties messageAttributes) throws PerfCakeException ;
Program: 59794
Project: 59794
Buggy source:
/** 
 * Actually performs the send operation. Should be overridden by specific implementations.
 * @param message Message to be sent.
 * @param measurementUnit Measurement unit carrying the current stop-watch.
 * @return Response to the message.
 * @throws Exception When the sending operation failed.
 * @see org.perfcake.message.sender.MessageSender#send(org.perfcake.message.Message,org.perfcake.reporting.MeasurementUnit)
 */
abstract public Serializable doSend(final Message message,final MeasurementUnit measurementUnit) throws Exception ;

Fixed version (ground truth):
/** 
 * Actually performs the send operation. Should be overridden by specific implementations.
 * @param message Message to be sent.
 * @param measurementUnit Measurement unit carrying the current stop-watch.
 * @return Response to the message.
 * @throws Exception When the sending operation failed.
 * @see org.perfcake.message.sender.MessageSender#send(org.perfcake.message.Message,org.perfcake.reporting.MeasurementUnit)
 */
public abstract Serializable doSend(final Message message,final MeasurementUnit measurementUnit) throws Exception ;
Program: 59795
Project: 59795
Buggy source:
abstract public String doGetNext();

Fixed version (ground truth):
public abstract String doGetNext();
Program: 59796
Project: 59796
Buggy source:
abstract public void doReset() throws PerfCakeException ;

Fixed version (ground truth):
public abstract void doReset() throws PerfCakeException ;
Program: 59797
Project: 59797
Buggy source:
@Override public int hashCode(){
  int result;
  long temp;
  result=(int)(iteration ^ (iteration >>> 32));
  result=31 * result + (int)(startTime ^ (startTime >>> 32));
  result=31 * result + (int)(stopTime ^ (stopTime >>> 32));
  temp=Double.doubleToLongBits(totalTime);
  result=31 * result + (int)(temp ^ (temp >>> 32));
  result=31 * result + measurementResults.hashCode();
  result=31 * result + (int)(timeStarted ^ (timeStarted >>> 32));
  result=31 * result + (int)(enqueueTime ^ (enqueueTime >>> 32));
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result;
  result=(int)(iteration ^ (iteration >>> 32));
  result=31 * result + (int)(startTime ^ (startTime >>> 32));
  result=31 * result + (int)(stopTime ^ (stopTime >>> 32));
  long temp=Double.doubleToLongBits(totalTime);
  result=31 * result + (int)(temp ^ (temp >>> 32));
  result=31 * result + measurementResults.hashCode();
  result=31 * result + (int)(timeStarted ^ (timeStarted >>> 32));
  result=31 * result + (int)(enqueueTime ^ (enqueueTime >>> 32));
  return result;
}
Program: 59798
Project: 59798
Buggy source:
/** 
 * Shutdowns reporting task thread and waits for the reporting tasks to be finished.
 */
private void waitForReportingTasks(){
  if (runInfo.getDuration().getPeriodType() == PeriodType.TIME) {
    long lastTasks=0, tasks=getTasksInQueue();
    reportingTasks.shutdown();
    while (tasks > 0 && tasks != lastTasks) {
      lastTasks=tasks;
      try {
        reportingTasks.awaitTermination(1,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ie) {
      }
      tasks=getTasksInQueue();
    }
    reportingTasks=null;
  }
 else {
    while (getTasksInQueue() > 0) {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException ie) {
      }
    }
    reportingTasks.shutdown();
    reportingTasks=null;
  }
}

Fixed version (ground truth):
/** 
 * Shutdowns reporting task thread and waits for the reporting tasks to be finished.
 */
private void waitForReportingTasks(){
  if (runInfo.getDuration().getPeriodType() == PeriodType.TIME) {
    long lastTasks=0;
    long tasks=getTasksInQueue();
    reportingTasks.shutdown();
    while (tasks > 0 && tasks != lastTasks) {
      lastTasks=tasks;
      try {
        reportingTasks.awaitTermination(1,TimeUnit.SECONDS);
      }
 catch (      InterruptedException ie) {
      }
      tasks=getTasksInQueue();
    }
    reportingTasks=null;
  }
 else {
    while (getTasksInQueue() > 0) {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException ie) {
      }
    }
    reportingTasks.shutdown();
    reportingTasks=null;
  }
}