nus-yam/ex-repair huggingface dataset:
Program: 141369
Project: 141369
Buggy source:
private DataFormat getGenomeDataFormat(final Sample s) throws EoulsanException {
  if (!s.getMetadata().isGenomeField())   return null;
  final String genomeSource=s.getMetadata().getGenome();
  if (genomeSource == null || "String_Node_Str".equals(genomeSource))   throw new EoulsanException("String_Node_Str" + s.getId() + "String_Node_Str");
  DataFormat readsDF;
  try {
    readsDF=new DataFile(genomeSource).getMetaData().getDataFormat();
    if (readsDF == null)     throw new EoulsanException("String_Node_Str" + s.getSource());
    return readsDF;
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + s.getSource());
  }
}

Fixed version (ground truth):
private DataFormat getGenomeDataFormat(final Sample s) throws EoulsanException {
  if (!s.getMetadata().isGenomeField())   return null;
  final String genomeSource=s.getMetadata().getGenome();
  if (genomeSource == null || "String_Node_Str".equals(genomeSource))   throw new EoulsanException("String_Node_Str" + s.getId() + "String_Node_Str");
  final DataFile genomeFile=new DataFile(genomeSource);
  if (!genomeFile.exists())   return null;
  DataFormat genomeFormat;
  try {
    genomeFormat=genomeFile.getMetaData().getDataFormat();
    if (genomeFormat == null)     throw new EoulsanException("String_Node_Str" + s.getSource());
    return genomeFormat;
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + s.getSource());
  }
}
Program: 141371
Project: 141371
Buggy source:
private DataFormat getAnnotationDataFormat(final Sample s) throws EoulsanException {
  if (!s.getMetadata().isAnnotationField())   return null;
  final String annotationSource=s.getMetadata().getAnnotation();
  if (annotationSource == null || "String_Node_Str".equals(annotationSource))   throw new EoulsanException("String_Node_Str" + s.getId() + "String_Node_Str");
  DataFormat annotDF;
  try {
    annotDF=new DataFile(annotationSource).getMetaData().getDataFormat();
    if (annotDF == null)     throw new EoulsanException("String_Node_Str" + s.getSource());
    return annotDF;
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + s.getSource());
  }
}

Fixed version (ground truth):
private DataFormat getAnnotationDataFormat(final Sample s) throws EoulsanException {
  if (!s.getMetadata().isAnnotationField())   return null;
  final String annotationSource=s.getMetadata().getAnnotation();
  if (annotationSource == null || "String_Node_Str".equals(annotationSource))   throw new EoulsanException("String_Node_Str" + s.getId() + "String_Node_Str");
  final DataFile annotationFile=new DataFile(annotationSource);
  if (!annotationFile.exists()) {
    return null;
  }
  DataFormat annotDF;
  try {
    annotDF=annotationFile.getMetaData().getDataFormat();
    if (annotDF == null)     throw new EoulsanException("String_Node_Str" + s.getSource());
    return annotDF;
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + s.getSource());
  }
}
Program: 141372
Project: 141372
Buggy source:
@Override protected void copy(final Map<DataFile,DataFile> files) throws IOException {
  if (files == null)   throw new NullPointerException("String_Node_Str");
  final Set<DataFile> stdCopyFiles=new HashSet<DataFile>();
  final DataProtocol fileProtocol=DataProtocolService.getInstance().getProtocol("String_Node_Str");
  for (  Map.Entry<DataFile,DataFile> e : files.entrySet()) {
    final DataFile src=e.getKey();
    final DataFile dest=e.getValue();
    if (e.getKey().getProtocol() == fileProtocol) {
      new DataFormatConverter(src,dest).convert();
      stdCopyFiles.add(src);
    }
  }
  for (  DataFile file : stdCopyFiles)   files.remove(file);
  if (files.size() > 0) {
    final Path jobPath=PathUtils.createTempPath(new Path(getDest().getSource()),"String_Node_Str","String_Node_Str",this.conf);
    DataSourceDistCp distCp=new DataSourceDistCp(this.conf,jobPath);
    distCp.copy(files);
  }
}

Fixed version (ground truth):
@Override protected void copy(final Map<DataFile,DataFile> files) throws IOException {
  if (files == null)   throw new NullPointerException("String_Node_Str");
  final Set<DataFile> stdCopyFiles=new HashSet<DataFile>();
  final DataProtocol fileProtocol=DataProtocolService.getInstance().getProtocol("String_Node_Str");
  for (  Map.Entry<DataFile,DataFile> e : files.entrySet()) {
    final DataFile src=e.getKey();
    final DataFile dest=e.getValue();
    if (src == null || dest == null) {
      continue;
    }
    if (e.getKey().getProtocol() == fileProtocol) {
      new DataFormatConverter(src,dest).convert();
      stdCopyFiles.add(src);
    }
  }
  for (  DataFile file : stdCopyFiles)   files.remove(file);
  if (files.size() > 0) {
    final Path jobPath=PathUtils.createTempPath(new Path(getDest().getSource()),"String_Node_Str","String_Node_Str",this.conf);
    DataSourceDistCp distCp=new DataSourceDistCp(this.conf,jobPath);
    distCp.copy(files);
  }
}
Program: 141373
Project: 141373
Buggy source:
@Override protected DataFile getUploadedDataFile(final DataFile file,final int id) throws IOException {
  final DataFile dest=getDest();
  DataFile result=null;
  DataFormat df=file.getMetaData().getDataFormat();
  if (df == DataFormats.READS_FASTQ || df == DataFormats.READS_TFQ)   result=new DataFile(dest,DataFormats.READS_TFQ.getType().getPrefix() + id + DataFormats.READS_TFQ.getDefaultExtention());
  if (df == DataFormats.GENOME_FASTA)   result=new DataFile(dest,DataFormats.GENOME_FASTA.getType().getPrefix() + id + DataFormats.GENOME_FASTA.getDefaultExtention());
  if (df == DataFormats.ANNOTATION_GFF)   result=new DataFile(dest,DataFormats.ANNOTATION_GFF.getType().getPrefix() + id + DataFormats.ANNOTATION_GFF.getDefaultExtention());
  if (result == null)   result=new DataFile(dest,file.getName());
  return result;
}

Fixed version (ground truth):
@Override protected DataFile getUploadedDataFile(final DataFile file,final int id) throws IOException {
  if (file == null || !file.exists())   return null;
  final DataFile dest=getDest();
  DataFile result=null;
  DataFormat df=file.getMetaData().getDataFormat();
  if (df == DataFormats.READS_FASTQ || df == DataFormats.READS_TFQ)   result=new DataFile(dest,DataFormats.READS_TFQ.getType().getPrefix() + id + DataFormats.READS_TFQ.getDefaultExtention());
  if (df == DataFormats.GENOME_FASTA)   result=new DataFile(dest,DataFormats.GENOME_FASTA.getType().getPrefix() + id + DataFormats.GENOME_FASTA.getDefaultExtention());
  if (df == DataFormats.ANNOTATION_GFF)   result=new DataFile(dest,DataFormats.ANNOTATION_GFF.getType().getPrefix() + id + DataFormats.ANNOTATION_GFF.getDefaultExtention());
  if (result == null)   result=new DataFile(dest,file.getName());
  return result;
}
Program: 141374
Project: 141374
Buggy source:
@Override protected void copy(final Map<DataFile,DataFile> files) throws IOException {
  if (files == null)   throw new NullPointerException("String_Node_Str");
  for (  Map.Entry<DataFile,DataFile> e : files.entrySet()) {
    LOGGER.info("String_Node_Str" + e.getKey() + "String_Node_Str"+ e.getValue());
    new DataFormatConverter(e.getKey(),e.getValue()).convert();
  }
}

Fixed version (ground truth):
@Override protected void copy(final Map<DataFile,DataFile> files) throws IOException {
  if (files == null)   throw new NullPointerException("String_Node_Str");
  for (  Map.Entry<DataFile,DataFile> e : files.entrySet()) {
    final DataFile src=e.getKey();
    final DataFile dest=e.getValue();
    if (src == null || dest == null) {
      continue;
    }
    LOGGER.info("String_Node_Str" + src + "String_Node_Str"+ dest);
    new DataFormatConverter(src,dest).convert();
  }
}
Program: 141375
Project: 141375
Buggy source:
@Override protected DataFile getUploadedDataFile(final DataFile file,final int id) throws IOException {
  return new DataFile(getDest(),file.getName());
}

Fixed version (ground truth):
@Override protected DataFile getUploadedDataFile(final DataFile file,final int id) throws IOException {
  final String filename;
  if (file.getName().endsWith("String_Node_Str") || file.getName().endsWith("String_Node_Str") || file.getName().endsWith("String_Node_Str")|| file.getName().endsWith("String_Node_Str"))   filename=file.getName();
 else   filename=CompressionType.removeCompressionExtension(file.getName()) + CompressionType.BZIP2.getExtension();
  return new DataFile(getDest(),filename);
}
Program: 141378
Project: 141378
Buggy source:
@Override public boolean accept(final Path p){
  final String filename=p.getName();
  if (filename.startsWith("String_Node_Str") && filename.endsWith("String_Node_Str"))   return true;
  return false;
}

Fixed version (ground truth):
@Override public boolean accept(final Path p){
  final String filename=p.getName();
  final DataFormat df=DataFormats.EXPRESSION_RESULTS_TXT;
  if (filename.startsWith(df.getType().getPrefix()) && filename.endsWith(df.getDefaultExtention()))   return true;
  return false;
}
Program: 141379
Project: 141379
Buggy source:
/** 
 * Get the filename without the extension.
 * @param filename The filename
 * @return the filename without the extension
 */
public static String filenameWithoutExtension(final String filename){
  if (filename == null)   return null;
  final File f=new File(filename);
  final String shortName=f.getName();
  final int pos=shortName.lastIndexOf('.');
  if (pos == -1)   return filename;
  return filename.substring(0,pos);
}

Fixed version (ground truth):
/** 
 * Get the filename without the extension.
 * @param filename The filename
 * @return the filename without the extension
 */
public static String filenameWithoutExtension(final String filename){
  if (filename == null)   return null;
  final File f=new File(filename);
  final String shortName=f.getName();
  final int pos=shortName.lastIndexOf('.');
  if (pos == -1)   return filename;
  return filename.substring(0,filename.length() - shortName.length()) + shortName.subSequence(0,pos);
}
Program: 141380
Project: 141380
Buggy source:
/** 
 * Get the filename without the extension.
 * @param filename The filename
 * @return the filename without the extension
 */
public static String filenameWithoutExtension(final String filename){
  if (filename == null)   return null;
  final File f=new File(filename);
  final String shortName=f.getName();
  final int pos=shortName.lastIndexOf('.');
  if (pos == -1)   return filename;
  return filename.substring(0,pos);
}

Fixed version (ground truth):
/** 
 * Get the filename without the extension.
 * @param filename The filename
 * @return the filename without the extension
 */
public static String filenameWithoutExtension(final String filename){
  if (filename == null)   return null;
  final File f=new File(filename);
  final String shortName=f.getName();
  final int pos=shortName.lastIndexOf('.');
  if (pos == -1)   return filename;
  return filename.substring(0,filename.length() - shortName.length()) + shortName.subSequence(0,pos);
}
Program: 141382
Project: 141382
Buggy source:
@Override public boolean accept(final Path p){
  final String filename=p.getName();
  if (filename.startsWith("String_Node_Str") && filename.endsWith("String_Node_Str"))   return true;
  return false;
}

Fixed version (ground truth):
@Override public boolean accept(final Path p){
  final String filename=p.getName();
  final DataFormat df=DataFormats.EXPRESSION_RESULTS_TXT;
  if (filename.startsWith(df.getType().getPrefix()) && filename.endsWith(df.getDefaultExtention()))   return true;
  return false;
}
Program: 141384
Project: 141384
Buggy source:
@Override public void close() throws IOException {
  super.close();
  final SimpleDataFileMetadata md2=new SimpleDataFileMetadata(md);
  if (md2.getContentLength() < 0)   md2.setContentLength(f.length());
  new FileToUpload(dest,FileUtils.createInputStream(f),md2).upload();
  if (!f.delete())   logger.severe("String_Node_Str" + f.getAbsolutePath());
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  super.close();
  final SimpleDataFileMetadata md2=new SimpleDataFileMetadata(md);
  if (md2.getContentLength() < 0)   md2.setContentLength(f.length());
  new FileToUpload(dest,FileUtils.createInputStream(f),md2).upload();
  if (!f.delete())   LOGGER.severe("String_Node_Str" + f.getAbsolutePath());
}
Program: 141386
Project: 141386
Buggy source:
@Override public void close() throws IOException {
  super.close();
  final SimpleDataFileMetadata md2=new SimpleDataFileMetadata(md);
  if (md2.getContentLength() < 0)   md2.setContentLength(f.length());
  new FileToUpload(dest,FileUtils.createInputStream(f),md2).upload();
  if (!f.delete())   logger.severe("String_Node_Str" + f.getAbsolutePath());
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  super.close();
  final SimpleDataFileMetadata md2=new SimpleDataFileMetadata(md);
  if (md2.getContentLength() < 0)   md2.setContentLength(f.length());
  new FileToUpload(dest,FileUtils.createInputStream(f),md2).upload();
  if (!f.delete())   LOGGER.severe("String_Node_Str" + f.getAbsolutePath());
}
Program: 141387
Project: 141387
Buggy source:
/** 
 * Private constructor.
 */
@SuppressWarnings("String_Node_Str") private StepService(){
  final Set<Class<? extends Annotation>> autorisedAnnotations;
  if (EoulsanRuntime.getRuntime().isAmazonMode()) {
    autorisedAnnotations=Sets.newHashSet(HadoopOnly.class,HadoopCompatible.class);
  }
 else {
    autorisedAnnotations=Sets.newHashSet(LocalOnly.class,HadoopCompatible.class);
  }
  loader=ServiceLoader.load(Step.class,new ServiceClassLoader(autorisedAnnotations));
}

Fixed version (ground truth):
/** 
 * Private constructor.
 */
@SuppressWarnings("String_Node_Str") private StepService(){
  final Set<Class<? extends Annotation>> autorisedAnnotations;
  if (EoulsanRuntime.getRuntime().isHadoopMode()) {
    autorisedAnnotations=Sets.newHashSet(HadoopOnly.class,HadoopCompatible.class);
  }
 else {
    autorisedAnnotations=Sets.newHashSet(LocalOnly.class,HadoopCompatible.class);
  }
  loader=ServiceLoader.load(Step.class,new ServiceClassLoader(autorisedAnnotations));
}
Program: 141388
Project: 141388
Buggy source:
/** 
 * Retrieve definitions from the first provider that contains the word.
 */
public Step getStep(final String stepName){
  final boolean hadoopMode=EoulsanRuntime.getRuntime().isHadoopMode();
  final Iterator<Step> it=this.loader.iterator();
  while (it.hasNext()) {
    try {
      final Step step=it.next();
      if (step.getName().equals(stepName)) {
        return step;
      }
    }
 catch (    ServiceConfigurationError e) {
      LOGGER.info("String_Node_Str" + (hadoopMode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ e.getClass());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve definitions from the first provider that contains the word.
 */
public Step getStep(final String stepName){
  final boolean hadoopMode=EoulsanRuntime.getRuntime().isHadoopMode();
  final Iterator<Step> it=this.loader.iterator();
  while (it.hasNext()) {
    try {
      final Step step=it.next();
      if (step.getName().equals(stepName)) {
        return step;
      }
    }
 catch (    ServiceConfigurationError e) {
      LOGGER.info("String_Node_Str" + (hadoopMode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ e.getMessage());
    }
  }
  return null;
}
Program: 141389
Project: 141389
Buggy source:
/** 
 * Private constructor.
 */
@SuppressWarnings("String_Node_Str") private StepService(){
  final Set<Class<? extends Annotation>> autorisedAnnotations;
  if (EoulsanRuntime.getRuntime().isAmazonMode()) {
    autorisedAnnotations=Sets.newHashSet(HadoopOnly.class,HadoopCompatible.class);
  }
 else {
    autorisedAnnotations=Sets.newHashSet(LocalOnly.class,HadoopCompatible.class);
  }
  loader=ServiceLoader.load(Step.class,new ServiceClassLoader(autorisedAnnotations));
}

Fixed version (ground truth):
/** 
 * Private constructor.
 */
@SuppressWarnings("String_Node_Str") private StepService(){
  final Set<Class<? extends Annotation>> autorisedAnnotations;
  if (EoulsanRuntime.getRuntime().isHadoopMode()) {
    autorisedAnnotations=Sets.newHashSet(HadoopOnly.class,HadoopCompatible.class);
  }
 else {
    autorisedAnnotations=Sets.newHashSet(LocalOnly.class,HadoopCompatible.class);
  }
  loader=ServiceLoader.load(Step.class,new ServiceClassLoader(autorisedAnnotations));
}
Program: 141390
Project: 141390
Buggy source:
/** 
 * Retrieve definitions from the first provider that contains the word.
 */
public Step getStep(final String stepName){
  final boolean hadoopMode=EoulsanRuntime.getRuntime().isHadoopMode();
  final Iterator<Step> it=this.loader.iterator();
  while (it.hasNext()) {
    try {
      final Step step=it.next();
      if (step.getName().equals(stepName)) {
        return step;
      }
    }
 catch (    ServiceConfigurationError e) {
      LOGGER.info("String_Node_Str" + (hadoopMode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ e.getClass());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Retrieve definitions from the first provider that contains the word.
 */
public Step getStep(final String stepName){
  final boolean hadoopMode=EoulsanRuntime.getRuntime().isHadoopMode();
  final Iterator<Step> it=this.loader.iterator();
  while (it.hasNext()) {
    try {
      final Step step=it.next();
      if (step.getName().equals(stepName)) {
        return step;
      }
    }
 catch (    ServiceConfigurationError e) {
      LOGGER.info("String_Node_Str" + (hadoopMode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ e.getMessage());
    }
  }
  return null;
}
Program: 141391
Project: 141391
Buggy source:
/** 
 * Create the soap index in a directory.
 * @param genomeFile path to the genome file
 * @param outputDir output directory for the index
 * @throws IOException if an error occurs while creating the index
 */
public static void makeIndex(final File genomeFile,final File outputDir) throws IOException {
  if (genomeFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  LOGGER.info("String_Node_Str" + genomeFile);
  final long startTime=System.currentTimeMillis();
synchronized (indexerPath) {
    if (indexerPath == null) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  if (!outputDir.exists() && !outputDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  final File tmpGenomeFile=new File(outputDir,genomeFile.getName());
  FileUtils.createSymbolicLink(genomeFile,tmpGenomeFile);
  final String cmd=indexerPath + "String_Node_Str" + tmpGenomeFile.getAbsolutePath();
  ProcessUtils.exec(cmd,DEBUG);
  if (!tmpGenomeFile.delete()) {
    LOGGER.warning("String_Node_Str");
  }
  final long endTime=System.currentTimeMillis();
  LOGGER.info("String_Node_Str" + StringUtils.toTimeHumanReadable(endTime - startTime));
}

Fixed version (ground truth):
/** 
 * Create the soap index in a directory.
 * @param genomeFile path to the genome file
 * @param outputDir output directory for the index
 * @throws IOException if an error occurs while creating the index
 */
public static void makeIndex(final File genomeFile,final File outputDir) throws IOException {
  if (genomeFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  LOGGER.info("String_Node_Str" + genomeFile);
  final long startTime=System.currentTimeMillis();
  if (indexerPath == null) {
synchronized (SYNC) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  if (!outputDir.exists() && !outputDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  final File tmpGenomeFile=new File(outputDir,genomeFile.getName());
  FileUtils.createSymbolicLink(genomeFile,tmpGenomeFile);
  final String cmd=indexerPath + "String_Node_Str" + tmpGenomeFile.getAbsolutePath();
  ProcessUtils.exec(cmd,DEBUG);
  if (!tmpGenomeFile.delete()) {
    LOGGER.warning("String_Node_Str");
  }
  final long endTime=System.currentTimeMillis();
  LOGGER.info("String_Node_Str" + StringUtils.toTimeHumanReadable(endTime - startTime));
}
Program: 141392
Project: 141392
Buggy source:
/** 
 * Create a soap command line for mapping reads using soap in pipe mode.
 * @param soapIndexDir soap index file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static String mapPipe(final File soapIndexDir,final String soapArgs,final int nbSoapThreads) throws IOException {
synchronized (soapPath) {
    if (soapPath == null) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  LOGGER.info(cmd);
  return cmd;
}

Fixed version (ground truth):
/** 
 * Create a soap command line for mapping reads using soap in pipe mode.
 * @param soapIndexDir soap index file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static String mapPipe(final File soapIndexDir,final String soapArgs,final int nbSoapThreads) throws IOException {
  if (soapPath == null) {
synchronized (SYNC) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  LOGGER.info(cmd);
  return cmd;
}
Program: 141393
Project: 141393
Buggy source:
/** 
 * Create the soap index in a zip archive.
 * @param genomeFile path to the genome file
 * @return a File object with the path of the result zip file
 * @throws IOException if an error occurs while creating the index
 */
public static File makeIndexInZipFile(final File genomeFile) throws IOException {
  LOGGER.info("String_Node_Str");
synchronized (indexerPath) {
    if (indexerPath == null) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  final File tmpDir=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  if (!(tmpDir.delete())) {
    throw new IOException("String_Node_Str" + tmpDir.getAbsolutePath() + "String_Node_Str");
  }
  if (!tmpDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  makeIndex(genomeFile,tmpDir);
  final File indexZipFile=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  FileUtils.createZip(tmpDir,indexZipFile);
  FileUtils.removeDirectory(tmpDir);
  LOGGER.info("String_Node_Str");
  return indexZipFile;
}

Fixed version (ground truth):
/** 
 * Create the soap index in a zip archive.
 * @param genomeFile path to the genome file
 * @return a File object with the path of the result zip file
 * @throws IOException if an error occurs while creating the index
 */
public static File makeIndexInZipFile(final File genomeFile) throws IOException {
  LOGGER.info("String_Node_Str");
  if (indexerPath == null) {
synchronized (SYNC) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  final File tmpDir=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  if (!(tmpDir.delete())) {
    throw new IOException("String_Node_Str" + tmpDir.getAbsolutePath() + "String_Node_Str");
  }
  if (!tmpDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  makeIndex(genomeFile,tmpDir);
  final File indexZipFile=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  FileUtils.createZip(tmpDir,indexZipFile);
  FileUtils.removeDirectory(tmpDir);
  LOGGER.info("String_Node_Str");
  return indexZipFile;
}
Program: 141394
Project: 141394
Buggy source:
/** 
 * Map reads using soap.
 * @param readsFile reads file
 * @param soapIndexDir soap index file
 * @param outputFile output alignment file
 * @param unmapFile output unmap file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static void map(final File readsFile,final File soapIndexDir,final File outputFile,final File unmapFile,final String soapArgs,final int nbSoapThreads) throws IOException {
synchronized (soapPath) {
    if (soapPath == null) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ readsFile.getAbsolutePath()+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ outputFile.getAbsolutePath()+ "String_Node_Str"+ unmapFile.getAbsolutePath()+ "String_Node_Str";
  LOGGER.info(cmd);
  final int exitValue=ProcessUtils.sh(cmd);
  if (exitValue != 0) {
    throw new IOException("String_Node_Str" + exitValue);
  }
}

Fixed version (ground truth):
/** 
 * Map reads using soap.
 * @param readsFile reads file
 * @param soapIndexDir soap index file
 * @param outputFile output alignment file
 * @param unmapFile output unmap file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static void map(final File readsFile,final File soapIndexDir,final File outputFile,final File unmapFile,final String soapArgs,final int nbSoapThreads) throws IOException {
  if (soapPath == null) {
synchronized (SYNC) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ readsFile.getAbsolutePath()+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ outputFile.getAbsolutePath()+ "String_Node_Str"+ unmapFile.getAbsolutePath()+ "String_Node_Str";
  LOGGER.info(cmd);
  final int exitValue=ProcessUtils.sh(cmd);
  if (exitValue != 0) {
    throw new IOException("String_Node_Str" + exitValue);
  }
}
Program: 141395
Project: 141395
Buggy source:
/** 
 * Create the soap index in a directory.
 * @param genomeFile path to the genome file
 * @param outputDir output directory for the index
 * @throws IOException if an error occurs while creating the index
 */
public static void makeIndex(final File genomeFile,final File outputDir) throws IOException {
  if (genomeFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  LOGGER.info("String_Node_Str" + genomeFile);
  final long startTime=System.currentTimeMillis();
synchronized (indexerPath) {
    if (indexerPath == null) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  if (!outputDir.exists() && !outputDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  final File tmpGenomeFile=new File(outputDir,genomeFile.getName());
  FileUtils.createSymbolicLink(genomeFile,tmpGenomeFile);
  final String cmd=indexerPath + "String_Node_Str" + tmpGenomeFile.getAbsolutePath();
  ProcessUtils.exec(cmd,DEBUG);
  if (!tmpGenomeFile.delete()) {
    LOGGER.warning("String_Node_Str");
  }
  final long endTime=System.currentTimeMillis();
  LOGGER.info("String_Node_Str" + StringUtils.toTimeHumanReadable(endTime - startTime));
}

Fixed version (ground truth):
/** 
 * Create the soap index in a directory.
 * @param genomeFile path to the genome file
 * @param outputDir output directory for the index
 * @throws IOException if an error occurs while creating the index
 */
public static void makeIndex(final File genomeFile,final File outputDir) throws IOException {
  if (genomeFile == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (outputDir == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  LOGGER.info("String_Node_Str" + genomeFile);
  final long startTime=System.currentTimeMillis();
  if (indexerPath == null) {
synchronized (SYNC) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  if (!outputDir.exists() && !outputDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  final File tmpGenomeFile=new File(outputDir,genomeFile.getName());
  FileUtils.createSymbolicLink(genomeFile,tmpGenomeFile);
  final String cmd=indexerPath + "String_Node_Str" + tmpGenomeFile.getAbsolutePath();
  ProcessUtils.exec(cmd,DEBUG);
  if (!tmpGenomeFile.delete()) {
    LOGGER.warning("String_Node_Str");
  }
  final long endTime=System.currentTimeMillis();
  LOGGER.info("String_Node_Str" + StringUtils.toTimeHumanReadable(endTime - startTime));
}
Program: 141396
Project: 141396
Buggy source:
/** 
 * Create a soap command line for mapping reads using soap in pipe mode.
 * @param soapIndexDir soap index file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static String mapPipe(final File soapIndexDir,final String soapArgs,final int nbSoapThreads) throws IOException {
synchronized (soapPath) {
    if (soapPath == null) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  LOGGER.info(cmd);
  return cmd;
}

Fixed version (ground truth):
/** 
 * Create a soap command line for mapping reads using soap in pipe mode.
 * @param soapIndexDir soap index file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static String mapPipe(final File soapIndexDir,final String soapArgs,final int nbSoapThreads) throws IOException {
  if (soapPath == null) {
synchronized (SYNC) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  LOGGER.info(cmd);
  return cmd;
}
Program: 141397
Project: 141397
Buggy source:
/** 
 * Create the soap index in a zip archive.
 * @param genomeFile path to the genome file
 * @return a File object with the path of the result zip file
 * @throws IOException if an error occurs while creating the index
 */
public static File makeIndexInZipFile(final File genomeFile) throws IOException {
  LOGGER.info("String_Node_Str");
synchronized (indexerPath) {
    if (indexerPath == null) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  final File tmpDir=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  if (!(tmpDir.delete())) {
    throw new IOException("String_Node_Str" + tmpDir.getAbsolutePath() + "String_Node_Str");
  }
  if (!tmpDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  makeIndex(genomeFile,tmpDir);
  final File indexZipFile=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  FileUtils.createZip(tmpDir,indexZipFile);
  FileUtils.removeDirectory(tmpDir);
  LOGGER.info("String_Node_Str");
  return indexZipFile;
}

Fixed version (ground truth):
/** 
 * Create the soap index in a zip archive.
 * @param genomeFile path to the genome file
 * @return a File object with the path of the result zip file
 * @throws IOException if an error occurs while creating the index
 */
public static File makeIndexInZipFile(final File genomeFile) throws IOException {
  LOGGER.info("String_Node_Str");
  if (indexerPath == null) {
synchronized (SYNC) {
      indexerPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  final File tmpDir=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  if (!(tmpDir.delete())) {
    throw new IOException("String_Node_Str" + tmpDir.getAbsolutePath() + "String_Node_Str");
  }
  if (!tmpDir.mkdir()) {
    throw new IOException("String_Node_Str");
  }
  makeIndex(genomeFile,tmpDir);
  final File indexZipFile=File.createTempFile(Globals.APP_NAME_LOWER_CASE + "String_Node_Str","String_Node_Str");
  FileUtils.createZip(tmpDir,indexZipFile);
  FileUtils.removeDirectory(tmpDir);
  LOGGER.info("String_Node_Str");
  return indexZipFile;
}
Program: 141398
Project: 141398
Buggy source:
/** 
 * Map reads using soap.
 * @param readsFile reads file
 * @param soapIndexDir soap index file
 * @param outputFile output alignment file
 * @param unmapFile output unmap file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static void map(final File readsFile,final File soapIndexDir,final File outputFile,final File unmapFile,final String soapArgs,final int nbSoapThreads) throws IOException {
synchronized (soapPath) {
    if (soapPath == null) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ readsFile.getAbsolutePath()+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ outputFile.getAbsolutePath()+ "String_Node_Str"+ unmapFile.getAbsolutePath()+ "String_Node_Str";
  LOGGER.info(cmd);
  final int exitValue=ProcessUtils.sh(cmd);
  if (exitValue != 0) {
    throw new IOException("String_Node_Str" + exitValue);
  }
}

Fixed version (ground truth):
/** 
 * Map reads using soap.
 * @param readsFile reads file
 * @param soapIndexDir soap index file
 * @param outputFile output alignment file
 * @param unmapFile output unmap file
 * @param soapArgs soap arguments
 * @param nbSoapThreads number of threads to use
 * @throws IOException if an error occurs while mapping reads
 */
public static void map(final File readsFile,final File soapIndexDir,final File outputFile,final File unmapFile,final String soapArgs,final int nbSoapThreads) throws IOException {
  if (soapPath == null) {
synchronized (SYNC) {
      soapPath=BinariesInstaller.install("String_Node_Str");
    }
  }
  FileUtils.checkExistingDirectoryFile(soapIndexDir,"String_Node_Str");
  final File[] indexFiles=FileUtils.listFilesByExtension(soapIndexDir,"String_Node_Str");
  if (indexFiles == null || indexFiles.length != 1) {
    throw new IOException("String_Node_Str");
  }
  final String ambFile=indexFiles[0].getAbsolutePath();
  final String cmd=soapPath + "String_Node_Str" + soapArgs+ "String_Node_Str"+ nbSoapThreads+ "String_Node_Str"+ readsFile.getAbsolutePath()+ "String_Node_Str"+ ambFile.substring(0,ambFile.length() - 4)+ "String_Node_Str"+ outputFile.getAbsolutePath()+ "String_Node_Str"+ unmapFile.getAbsolutePath()+ "String_Node_Str";
  LOGGER.info(cmd);
  final int exitValue=ProcessUtils.sh(cmd);
  if (exitValue != 0) {
    throw new IOException("String_Node_Str" + exitValue);
  }
}
Program: 141399
Project: 141399
Buggy source:
/** 
 * Set the version.
 * @param version The version to set
 */
public void setVersion(final String version){
  if (version == null)   return;
  String v=version.trim();
  if (version.endsWith("String_Node_Str"))   v=version.replaceAll("String_Node_Str","String_Node_Str");
  if (v.matches("String_Node_Str")) {
    String[] ch=v.split("String_Node_Str");
    setVersion(Integer.parseInt(ch[0].trim()),Integer.parseInt(ch[1].trim()),Integer.parseInt(ch[2].trim()));
  }
 else   throw new InvalidParameterException("String_Node_Str" + version);
}

Fixed version (ground truth):
/** 
 * Set the version.
 * @param version The version to set
 */
public void setVersion(final String version){
  if (version == null)   return;
  String v=version.trim();
  if (version.endsWith("String_Node_Str"))   v=version.replaceAll("String_Node_Str","String_Node_Str");
  final String[] fields=v.split("String_Node_Str");
  int major=0;
  int minor=0;
  int revision=0;
  try {
    if (fields.length > 0)     major=Integer.parseInt(fields[0].trim());
    if (fields.length > 1)     minor=Integer.parseInt(fields[1].trim());
    if (fields.length > 2)     revision=Integer.parseInt(fields[2].trim());
  }
 catch (  NumberFormatException e) {
    throw new InvalidParameterException("String_Node_Str" + version);
  }
  setVersion(major,minor,revision);
}
Program: 141400
Project: 141400
Buggy source:
/** 
 * Set the version.
 * @param version The version to set
 */
public void setVersion(final String version){
  if (version == null)   return;
  String v=version.trim();
  if (version.endsWith("String_Node_Str"))   v=version.replaceAll("String_Node_Str","String_Node_Str");
  if (v.matches("String_Node_Str")) {
    String[] ch=v.split("String_Node_Str");
    setVersion(Integer.parseInt(ch[0].trim()),Integer.parseInt(ch[1].trim()),Integer.parseInt(ch[2].trim()));
  }
 else   throw new InvalidParameterException("String_Node_Str" + version);
}

Fixed version (ground truth):
/** 
 * Set the version.
 * @param version The version to set
 */
public void setVersion(final String version){
  if (version == null)   return;
  String v=version.trim();
  if (version.endsWith("String_Node_Str"))   v=version.replaceAll("String_Node_Str","String_Node_Str");
  final String[] fields=v.split("String_Node_Str");
  int major=0;
  int minor=0;
  int revision=0;
  try {
    if (fields.length > 0)     major=Integer.parseInt(fields[0].trim());
    if (fields.length > 1)     minor=Integer.parseInt(fields[1].trim());
    if (fields.length > 2)     revision=Integer.parseInt(fields[2].trim());
  }
 catch (  NumberFormatException e) {
    throw new InvalidParameterException("String_Node_Str" + version);
  }
  setVersion(major,minor,revision);
}
Program: 141401
Project: 141401
Buggy source:
/** 
 * Reverse a map
 * @param map Map to reverse
 * @return The reverse map
 */
public static Map<String,Set<String>> reverseMap(Map<String,String> map){
  if (map == null)   return null;
  Map<String,Set<String>> result=new HashMap<String,Set<String>>();
  for (  Map.Entry<String,String> e : map.entrySet()) {
    final Set<String> set;
    final String value=e.getValue();
    if (!result.containsValue(value)) {
      set=new HashSet<String>();
      result.put(value,set);
    }
 else     set=result.get(value);
    set.add(e.getKey());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Reverse a map
 * @param map Map to reverse
 * @return The reverse map
 */
public static Map<String,Set<String>> reverseMap(final Map<String,String> map){
  if (map == null)   return null;
  final Map<String,Set<String>> result=new HashMap<String,Set<String>>();
  for (  Map.Entry<String,String> e : map.entrySet()) {
    final Set<String> set;
    final String value=e.getValue();
    if (!result.containsKey(value)) {
      set=new HashSet<String>();
      result.put(value,set);
    }
 else     set=result.get(value);
    set.add(e.getKey());
  }
  return result;
}
Program: 141402
Project: 141402
Buggy source:
/** 
 * Reverse a map
 * @param map Map to reverse
 * @return The reverse map
 */
public static Map<String,Set<String>> reverseMap(Map<String,String> map){
  if (map == null)   return null;
  Map<String,Set<String>> result=new HashMap<String,Set<String>>();
  for (  Map.Entry<String,String> e : map.entrySet()) {
    final Set<String> set;
    final String value=e.getValue();
    if (!result.containsValue(value)) {
      set=new HashSet<String>();
      result.put(value,set);
    }
 else     set=result.get(value);
    set.add(e.getKey());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Reverse a map
 * @param map Map to reverse
 * @return The reverse map
 */
public static Map<String,Set<String>> reverseMap(final Map<String,String> map){
  if (map == null)   return null;
  final Map<String,Set<String>> result=new HashMap<String,Set<String>>();
  for (  Map.Entry<String,String> e : map.entrySet()) {
    final Set<String> set;
    final String value=e.getValue();
    if (!result.containsKey(value)) {
      set=new HashSet<String>();
      result.put(value,set);
    }
 else     set=result.get(value);
    set.add(e.getKey());
  }
  return result;
}
Program: 141403
Project: 141403
Buggy source:
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public FastQWriter(final String outputFilename) throws FileNotFoundException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public FastQWriter(final String outputFilename) throws IOException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}
Program: 141404
Project: 141404
Buggy source:
/** 
 * Close the writer
 */
@Override public void close(){
  this.close();
}

Fixed version (ground truth):
/** 
 * Close the writer.
 * @throws IOException if an error occurs while closing the writer
 */
@Override public void close() throws IOException {
  this.writer.close();
}
Program: 141405
Project: 141405
Buggy source:
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public GFFWriter(final String outputFilename) throws FileNotFoundException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public GFFWriter(final String outputFilename) throws IOException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}
Program: 141406
Project: 141406
Buggy source:
/** 
 * Close the writer
 */
public void close(){
  this.sb=null;
  this.close();
}

Fixed version (ground truth):
/** 
 * Close the writer.
 * @throws IOException if an error occurs while closing the writer
 */
public void close() throws IOException {
  this.sb=null;
  this.writer.close();
}
Program: 141407
Project: 141407
Buggy source:
/** 
 * Compute mean quality score of the read. Illumina version.
 * @return the mean quality score of the read.
 */
public double meanQuality(){
  if (this.quality == null)   return Double.NaN;
  int score=0;
  final int len=quality.length();
  for (int i=0; i < len; i++)   score+=quality.charAt(i) - 64;
  return score / len;
}

Fixed version (ground truth):
/** 
 * Compute mean quality score of the read. Illumina version.
 * @return the mean quality score of the read.
 */
public double meanQuality(){
  if (this.quality == null)   return Double.NaN;
  int score=0;
  final int len=quality.length();
  for (int i=0; i < len; i++)   score+=quality.charAt(i) - 64;
  return score / (double)len;
}
Program: 141408
Project: 141408
Buggy source:
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public FastQWriter(final String outputFilename) throws FileNotFoundException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public FastQWriter(final String outputFilename) throws IOException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}
Program: 141409
Project: 141409
Buggy source:
/** 
 * Close the writer
 */
@Override public void close(){
  this.close();
}

Fixed version (ground truth):
/** 
 * Close the writer.
 * @throws IOException if an error occurs while closing the writer
 */
@Override public void close() throws IOException {
  this.writer.close();
}
Program: 141410
Project: 141410
Buggy source:
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public GFFWriter(final String outputFilename) throws FileNotFoundException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param outputFilename name of the file to use
 */
public GFFWriter(final String outputFilename) throws IOException {
  this.writer=FileUtils.createBufferedWriter(outputFilename);
}
Program: 141411
Project: 141411
Buggy source:
/** 
 * Close the writer
 */
public void close(){
  this.sb=null;
  this.close();
}

Fixed version (ground truth):
/** 
 * Close the writer.
 * @throws IOException if an error occurs while closing the writer
 */
public void close() throws IOException {
  this.sb=null;
  this.writer.close();
}
Program: 141412
Project: 141412
Buggy source:
/** 
 * Compute mean quality score of the read. Illumina version.
 * @return the mean quality score of the read.
 */
public double meanQuality(){
  if (this.quality == null)   return Double.NaN;
  int score=0;
  final int len=quality.length();
  for (int i=0; i < len; i++)   score+=quality.charAt(i) - 64;
  return score / len;
}

Fixed version (ground truth):
/** 
 * Compute mean quality score of the read. Illumina version.
 * @return the mean quality score of the read.
 */
public double meanQuality(){
  if (this.quality == null)   return Double.NaN;
  int score=0;
  final int len=quality.length();
  for (int i=0; i < len; i++)   score+=quality.charAt(i) - 64;
  return score / (double)len;
}