Program: 141008
Project: 141008
Buggy source:
private MapperProcess createMapperProcessSE(final EntryMapping mapping,final String bwaPath,final String indexPath,final File inputFile) throws IOException {
  boolean bwaAln=!MEM_FLAVOR.equals(mapping.getFlavor());
  if (bwaAln) {
    return new MapperProcess(mapping.getName(),mapping.getExecutor(),mapping.getTemporaryDirectory(),false,inputFile){
      private File saiFile;
      private File fastqFile;
      private FastqWriterThread writer;
      protected void additionalInit() throws IOException {
        final File tmpDir=EoulsanRuntime.getRuntime().getTempDirectory();
        final String uuid=getUUID();
        this.saiFile=new File(tmpDir,PREFIX_FILES + "String_Node_Str" + uuid+ SAI_EXTENSION);
        this.fastqFile=new File(tmpDir,PREFIX_FILES + "String_Node_Str" + uuid+ FASTQ_EXTENSION);
        FileUtils.createNamedPipe(this.saiFile);
        addFilesToRemove(saiFile,this.fastqFile);
        this.writer=new FastqWriterThread(this.fastqFile,"String_Node_Str");
      }
      @Override public void writeEntry(      final String name,      final String sequence,      final String quality) throws IOException {
        super.writeEntry(name,sequence,quality);
        this.writer.write(ReadSequence.toFastQ(name,sequence,quality) + '\n');
      }
      @Override public void writeEntry1(      final ReadSequence read) throws IOException {
        super.writeEntry1(read);
        this.writer.write(read.toFastQ() + '\n');
      }
      @Override public void closeEntriesWriter() throws IOException {
        super.closeWriter1();
        this.writer.close();
      }
      @Override public void closeWriter1() throws IOException {
        super.closeWriter1();
        this.writer.close();
      }
      @Override protected List<List<String>> createCommandLines(){
        final boolean illuminaFastq=mapping.getFastqFormat() == FASTQ_ILLUMINA || mapping.getFastqFormat() == FASTQ_ILLUMINA_1_5;
        final List<String> cmd1=new ArrayList<>();
        cmd1.add(bwaPath);
        cmd1.add(ALN_FLAVOR);
        if (illuminaFastq) {
          cmd1.add("String_Node_Str");
        }
        cmd1.addAll(mapping.getMapperArguments());
        cmd1.add("String_Node_Str");
        cmd1.add(mapping.getThreadNumber() + "String_Node_Str");
        cmd1.add("String_Node_Str");
        cmd1.add(this.saiFile.getAbsolutePath());
        cmd1.add(indexPath);
        cmd1.add(getNamedPipeFile1().getAbsolutePath());
        final List<String> cmd2=new ArrayList<>();
        cmd2.add(bwaPath);
        cmd2.add("String_Node_Str");
        cmd2.add(indexPath);
        cmd2.add(this.saiFile.getAbsolutePath());
        cmd2.add(this.fastqFile.getAbsolutePath());
        final List<List<String>> result=new ArrayList<>();
        result.add(cmd1);
        result.add(cmd2);
        return result;
      }
    }
;
  }
  return new MapperProcess(mapping.getName(),mapping.getExecutor(),mapping.getTemporaryDirectory(),false,inputFile){
    @Override protected List<List<String>> createCommandLines(){
      final List<String> cmd=new ArrayList<>();
      cmd.add(bwaPath);
      cmd.add(MEM_FLAVOR);
      cmd.addAll(mapping.getMapperArguments());
      cmd.add("String_Node_Str");
      cmd.add(mapping.getThreadNumber() + "String_Node_Str");
      cmd.add(indexPath);
      cmd.add(getNamedPipeFile1().getAbsolutePath());
      return Collections.singletonList(cmd);
    }
  }
;
}

Fixed version (ground truth):
private MapperProcess createMapperProcessSE(final EntryMapping mapping,final String bwaPath,final String indexPath,final File inputFile) throws IOException {
  boolean bwaAln=!MEM_FLAVOR.equals(mapping.getFlavor());
  if (bwaAln) {
    return new MapperProcess(mapping.getName(),mapping.getExecutor(),mapping.getTemporaryDirectory(),false,inputFile){
      private File saiFile;
      private File fastqFile;
      private FastqWriterThread writer;
      protected void additionalInit() throws IOException {
        final File tmpDir=EoulsanRuntime.getRuntime().getTempDirectory();
        final String uuid=getUUID();
        this.saiFile=new File(tmpDir,PREFIX_FILES + "String_Node_Str" + uuid+ SAI_EXTENSION);
        FileUtils.createNamedPipe(this.saiFile);
        if (inputFile == null) {
          this.fastqFile=new File(tmpDir,PREFIX_FILES + "String_Node_Str" + uuid+ FASTQ_EXTENSION);
          this.writer=new FastqWriterThread(this.fastqFile,"String_Node_Str");
        }
        addFilesToRemove(saiFile,this.fastqFile);
      }
      @Override public void writeEntry(      final String name,      final String sequence,      final String quality) throws IOException {
        super.writeEntry(name,sequence,quality);
        this.writer.write(ReadSequence.toFastQ(name,sequence,quality) + '\n');
      }
      @Override public void writeEntry1(      final ReadSequence read) throws IOException {
        super.writeEntry1(read);
        this.writer.write(read.toFastQ() + '\n');
      }
      @Override public void closeEntriesWriter() throws IOException {
        super.closeWriter1();
        this.writer.close();
      }
      @Override public void closeWriter1() throws IOException {
        super.closeWriter1();
        this.writer.close();
      }
      @Override protected List<List<String>> createCommandLines(){
        final boolean illuminaFastq=mapping.getFastqFormat() == FASTQ_ILLUMINA || mapping.getFastqFormat() == FASTQ_ILLUMINA_1_5;
        final List<String> cmd1=new ArrayList<>();
        cmd1.add(bwaPath);
        cmd1.add(ALN_FLAVOR);
        if (illuminaFastq) {
          cmd1.add("String_Node_Str");
        }
        cmd1.addAll(mapping.getMapperArguments());
        cmd1.add("String_Node_Str");
        cmd1.add(mapping.getThreadNumber() + "String_Node_Str");
        cmd1.add("String_Node_Str");
        cmd1.add(this.saiFile.getAbsolutePath());
        cmd1.add(indexPath);
        cmd1.add(getNamedPipeFile1().getAbsolutePath());
        final List<String> cmd2=new ArrayList<>();
        cmd2.add(bwaPath);
        cmd2.add("String_Node_Str");
        cmd2.add(indexPath);
        cmd2.add(this.saiFile.getAbsolutePath());
        if (inputFile != null) {
          cmd2.add(inputFile.getAbsolutePath());
        }
 else {
          cmd2.add(this.fastqFile.getAbsolutePath());
        }
        final List<List<String>> result=new ArrayList<>();
        result.add(cmd1);
        result.add(cmd2);
        return result;
      }
    }
;
  }
  return new MapperProcess(mapping.getName(),mapping.getExecutor(),mapping.getTemporaryDirectory(),false,inputFile){
    @Override protected List<List<String>> createCommandLines(){
      final List<String> cmd=new ArrayList<>();
      cmd.add(bwaPath);
      cmd.add(MEM_FLAVOR);
      cmd.addAll(mapping.getMapperArguments());
      cmd.add("String_Node_Str");
      cmd.add(mapping.getThreadNumber() + "String_Node_Str");
      cmd.add(indexPath);
      cmd.add(getNamedPipeFile1().getAbsolutePath());
      return Collections.singletonList(cmd);
    }
  }
;
}