nus-yam/ex-repair huggingface dataset:
Program: 141119
Project: 141119
Buggy source:
@Override public void reload(){
  try {
    for (    String filename : ServiceListLoader.load(this.clazz.getName())) {
      final String resourcePath=this.resourceBasePath + filename;
      getLogger().fine("String_Node_Str" + this.clazz.getSimpleName() + "String_Node_Str"+ filename+ "String_Node_Str");
      final S resource=load(getResourceAsStream(resourcePath));
      if (resource == null) {
        throw new EoulsanException("String_Node_Str" + resourcePath);
      }
      final String resourceName=getResourceName(resource);
      if (resourceName == null) {
        throw new EoulsanException("String_Node_Str" + resource);
      }
      addResource(resourceName,resourcePath);
    }
  }
 catch (  IOException|EoulsanException e) {
    throw new ServiceConfigurationError(e);
  }
}

Fixed version (ground truth):
@Override public void reload(){
  try {
    for (    String filename : ServiceListLoader.load(this.clazz.getName())) {
      final String resourcePath=this.resourceBasePath + filename;
      getLogger().fine("String_Node_Str" + this.clazz.getSimpleName() + "String_Node_Str"+ filename+ "String_Node_Str");
      final S resource=load(getResourceAsStream(resourcePath));
      if (resource == null) {
        throw new EoulsanException("String_Node_Str" + resourcePath);
      }
      final String resourceName=getResourceName(resource);
      if (resourceName == null) {
        throw new EoulsanException("String_Node_Str" + resource);
      }
      addResource(resourceName,resourcePath);
    }
  }
 catch (  IOException|EoulsanException e) {
    throw new ServiceConfigurationError("String_Node_Str",e);
  }
}
Program: 141120
Project: 141120
Buggy source:
@Override public void reload(){
  if (this.directories.isEmpty()) {
    return;
  }
  try {
    for (    DataFile directory : this.directories) {
      if (!directory.exists()) {
        return;
      }
      for (      String filename : findResourcePaths(directory)) {
        getLogger().fine("String_Node_Str" + this.clazz.getSimpleName() + "String_Node_Str"+ filename+ "String_Node_Str");
        final DataFile file=new DataFile(directory,filename);
        final S resource=load(file.open());
        if (resource == null) {
          throw new EoulsanException("String_Node_Str" + file);
        }
        final String resourceName=getResourceName(resource);
        if (resourceName == null) {
          throw new EoulsanException("String_Node_Str" + resource);
        }
        addResource(resourceName,file.getSource());
      }
    }
  }
 catch (  IOException|EoulsanException e) {
    throw new ServiceConfigurationError(e);
  }
}

Fixed version (ground truth):
@Override public void reload(){
  if (this.directories.isEmpty()) {
    return;
  }
  try {
    for (    DataFile directory : this.directories) {
      if (!directory.exists()) {
        return;
      }
      for (      String filename : findResourcePaths(directory)) {
        getLogger().fine("String_Node_Str" + this.clazz.getSimpleName() + "String_Node_Str"+ filename+ "String_Node_Str");
        final DataFile file=new DataFile(directory,filename);
        final S resource=load(file.open());
        if (resource == null) {
          throw new EoulsanException("String_Node_Str" + file);
        }
        final String resourceName=getResourceName(resource);
        if (resourceName == null) {
          throw new EoulsanException("String_Node_Str" + resource);
        }
        addResource(resourceName,file.getSource());
      }
    }
  }
 catch (  IOException|EoulsanException e) {
    throw new ServiceConfigurationError("String_Node_Str",e);
  }
}
Program: 141122
Project: 141122
Buggy source:
@Override public InputPorts getInputPorts(){
  final InputPortsBuilder builder=new InputPortsBuilder();
  if (this.inputFormat == DataFormats.READS_FASTQ) {
    builder.addPort("String_Node_Str",DataFormats.READS_FASTQ);
  }
 else {
    builder.addPort("String_Node_Str",DataFormats.MAPPER_RESULTS_SAM);
  }
  return builder.create();
}

Fixed version (ground truth):
@Override public InputPorts getInputPorts(){
  final InputPortsBuilder builder=new InputPortsBuilder();
  if (this.inputFormat == DataFormats.READS_FASTQ) {
    builder.addPort(DEFAULT_SINGLE_INPUT_PORT_NAME,DataFormats.READS_FASTQ);
  }
 else {
    builder.addPort(DEFAULT_SINGLE_INPUT_PORT_NAME,DataFormats.MAPPER_RESULTS_SAM);
  }
  return builder.create();
}
Program: 141124
Project: 141124
Buggy source:
/** 
 * Set the Docker URI.
 * @param uiName the UI name
 */
public void setDockerURI(final String uri){
  this.properties.setProperty(DOCKER_URI_KEY,uri);
}

Fixed version (ground truth):
/** 
 * Set the Docker URI.
 * @param uri the Docker URI
 */
public void setDockerURI(final String uri){
  this.properties.setProperty(DOCKER_URI_KEY,uri);
}
Program: 141125
Project: 141125
Buggy source:
/** 
 * Get the value of the setting as a boolean value
 * @return the value of the setting as an integer
 * @throws EoulsanException if the value is not an integer
 */
public boolean getBooleanSetting(final String settingName){
  return Boolean.parseBoolean(getSetting(settingName));
}

Fixed version (ground truth):
/** 
 * Get the value of the setting as a boolean value
 * @return the value of the setting as an integer
 */
public boolean getBooleanSetting(final String settingName){
  return Boolean.parseBoolean(getSetting(settingName));
}
Program: 141126
Project: 141126
Buggy source:
/** 
 * Add the provided alignment to a list of SAMRecord objects if this alignment has the same read name as the other alignments of the list.
 * @param alignment
 * @return true if the alignment provides is stored, i.e. if it has the sameread name as the other alignments already stored.
 * @return false if the alignment provides has not the same read name than theprevious one, so this alignment is not stored.
 */
public boolean addAlignment(final SAMRecord alignment){
  if (alignment == null) {
    return false;
  }
  final String name=parseAlignmentName(alignment);
  if (this.currentName == null) {
    this.currentName=name;
  }
 else {
    if (!this.currentName.equals(name)) {
      this.currentName=null;
      return false;
    }
  }
  this.list.add(alignment);
  return true;
}

Fixed version (ground truth):
/** 
 * Add the provided alignment to a list of SAMRecord objects if this alignment has the same read name as the other alignments of the list.
 * @param alignment SAM alignment
 * @return true if the alignment provides is stored, i.e. if it has the sameread name as the other alignments already stored.
 */
public boolean addAlignment(final SAMRecord alignment){
  if (alignment == null) {
    return false;
  }
  final String name=parseAlignmentName(alignment);
  if (this.currentName == null) {
    this.currentName=name;
  }
 else {
    if (!this.currentName.equals(name)) {
      this.currentName=null;
      return false;
    }
  }
  this.list.add(alignment);
  return true;
}
Program: 141127
Project: 141127
Buggy source:
/** 
 * Public constructor.
 * @param os output stream
 */
public ExpressionRecordWriter(final DataOutputStream out){
  this.out=out;
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param out output stream
 */
public ExpressionRecordWriter(final DataOutputStream out){
  this.out=out;
}
Program: 141128
Project: 141128
Buggy source:
/** 
 * Public constructor.
 * @param os output stream
 */
public FastqRecordWriter(DataOutputStream out){
  this.out=out;
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param out output stream
 */
public FastqRecordWriter(DataOutputStream out){
  this.out=out;
}
Program: 141129
Project: 141129
Buggy source:
/** 
 * Public constructor.
 * @param os output stream
 */
public SAMRecordWriter(final DataOutputStream out){
  this.out=out;
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param out output stream
 */
public SAMRecordWriter(final DataOutputStream out){
  this.out=out;
}
Program: 141130
Project: 141130
Buggy source:
/** 
 * Check if a binary bundled in the jar exists.
 * @param binaryFilename program to check
 * @return true if the binary exists
 * @throws IOException if an error occurs while installing binary
 */
protected boolean checkIfBinaryExists(final String binaryFilename){
  return BinariesInstaller.check(getSoftwarePackage(),this.mapperVersionToUse,binaryFilename);
}

Fixed version (ground truth):
/** 
 * Check if a binary bundled in the jar exists.
 * @param binaryFilename program to check
 * @return true if the binary exists
 */
protected boolean checkIfBinaryExists(final String binaryFilename){
  return BinariesInstaller.check(getSoftwarePackage(),this.mapperVersionToUse,binaryFilename);
}
Program: 141131
Project: 141131
Buggy source:
/** 
 * Get the name of a bowtie flavored binary.
 * @param binary the binary
 * @param firstFlavoredVersion first version of Bowtie to be flavored
 * @return the flavored binary name
 */
private String flavoredBinary(){
  final String flavor=getMapperFlavorToUse();
  if (flavor != null && LARGE_INDEX_FLAVOR.equals(flavor.trim().toLowerCase())) {
    return MAPPER_LARGE_INDEX_EXECUTABLE;
  }
  return MAPPER_STANDARD_EXECUTABLE;
}

Fixed version (ground truth):
/** 
 * Get the name of the flavored binary.
 * @return the flavored binary name
 */
private String flavoredBinary(){
  final String flavor=getMapperFlavorToUse();
  if (flavor != null && LARGE_INDEX_FLAVOR.equals(flavor.trim().toLowerCase())) {
    return MAPPER_LARGE_INDEX_EXECUTABLE;
  }
  return MAPPER_STANDARD_EXECUTABLE;
}
Program: 141132
Project: 141132
Buggy source:
/** 
 * Execute the step.
 * @param context Execution context
 * @param status of the step
 * @throws EoulsanException if an error occurs while executing step
 */
StepResult execute(StepContext context,StepStatus status);

Fixed version (ground truth):
/** 
 * Execute the step.
 * @param context Execution context
 * @param status of the step
 */
StepResult execute(StepContext context,StepStatus status);
Program: 141133
Project: 141133
Buggy source:
/** 
 * Create a step for a standard step.
 * @param workflow workflow of the step
 * @param id identifier of the step
 * @param stepName Step name
 * @param stepVrsion step version
 * @param skip true to skip execution of the step
 * @param parameters parameters of the step
 * @throws EoulsanException id an error occurs while creating the step
 */
public CommandWorkflowStep(final AbstractWorkflow workflow,final String id,final String stepName,final String stepVersion,final Set<Parameter> parameters,final boolean skip,final boolean copyResultsToOutput) throws EoulsanException {
  super(workflow,id,stepName,stepVersion,skip,copyResultsToOutput,parameters);
}

Fixed version (ground truth):
/** 
 * Create a step for a standard step.
 * @param workflow workflow of the step
 * @param id identifier of the step
 * @param stepName Step name
 * @param stepVersion step version
 * @param skip true to skip execution of the step
 * @param parameters parameters of the step
 * @throws EoulsanException id an error occurs while creating the step
 */
public CommandWorkflowStep(final AbstractWorkflow workflow,final String id,final String stepName,final String stepVersion,final Set<Parameter> parameters,final boolean skip,final boolean copyResultsToOutput) throws EoulsanException {
  super(workflow,id,stepName,stepVersion,skip,copyResultsToOutput,parameters);
}
Program: 141134
Project: 141134
Buggy source:
/** 
 * Set the metadata of a data object from the information of another data object.
 * @param data the data object
 * @param dataSourceOfMetadata data source of metadata
 * @param sample the sample
 */
public static void setDataMetadata(final Data data,final Data dataSourceOfMetadata){
  checkNotNull(data,"String_Node_Str");
  checkNotNull(dataSourceOfMetadata,"String_Node_Str");
  if (data.isList()) {
    return;
  }
  final DataMetadata metadata=data.getMetadata();
  if (dataSourceOfMetadata.isList()) {
    for (    Data d : dataSourceOfMetadata.getListElements()) {
      metadata.set(d.getMetadata());
    }
  }
 else {
    metadata.set(dataSourceOfMetadata.getMetadata());
  }
}

Fixed version (ground truth):
/** 
 * Set the metadata of a data object from the information of another data object.
 * @param data the data object
 * @param dataSourceOfMetadata data source of metadata
 */
public static void setDataMetadata(final Data data,final Data dataSourceOfMetadata){
  checkNotNull(data,"String_Node_Str");
  checkNotNull(dataSourceOfMetadata,"String_Node_Str");
  if (data.isList()) {
    return;
  }
  final DataMetadata metadata=data.getMetadata();
  if (dataSourceOfMetadata.isList()) {
    for (    Data d : dataSourceOfMetadata.getListElements()) {
      metadata.set(d.getMetadata());
    }
  }
 else {
    metadata.set(dataSourceOfMetadata.getMetadata());
  }
}
Program: 141135
Project: 141135
Buggy source:
/** 
 * Get a DataFormat from its alias.
 * @param dataFormatAlias the name of the DataFormat to get
 * @return a DataFormat if found or null
 */
public DataFormat getDataFormatFromNameOrAlias(final String name){
  DataFormat result=getDataFormatFromName(name);
  return result != null ? result : getDataFormatFromAlias(name);
}

Fixed version (ground truth):
/** 
 * Get a DataFormat from its alias.
 * @param name the name of the DataFormat to get
 * @return a DataFormat if found or null
 */
public DataFormat getDataFormatFromNameOrAlias(final String name){
  DataFormat result=getDataFormatFromName(name);
  return result != null ? result : getDataFormatFromAlias(name);
}
Program: 141136
Project: 141136
Buggy source:
/** 
 * Set the project name
 * @param experiment
 */
void setExperiment(String experiment);

Fixed version (ground truth):
/** 
 * Set the project name
 * @param experiment the name of the experiment
 */
void setExperiment(String experiment);
Program: 141137
Project: 141137
Buggy source:
/** 
 * Set the UUID of the sample.
 * @param uuid
 */
void setUUID(final String uuid);

Fixed version (ground truth):
/** 
 * Set the UUID of the sample.
 * @param uuid The UUID of the sample
 */
void setUUID(final String uuid);
Program: 141138
Project: 141138
Buggy source:
/** 
 * Create a bzip2 input stream.
 * @param is
 * @return
 * @throws IOException
 */
public static InputStream createBZip2InputStream(final InputStream is) throws IOException {
  return new BZip2CompressorInputStream(is);
}

Fixed version (ground truth):
/** 
 * Create a bzip2 input stream.
 * @param is input stream
 * @return an uncompressed input stream
 * @throws IOException if an error occurs while creating the input stream
 */
public static InputStream createBZip2InputStream(final InputStream is) throws IOException {
  return new BZip2CompressorInputStream(is);
}
Program: 141139
Project: 141139
Buggy source:
/** 
 * Create a bzip2 input stream.
 * @param is
 * @return
 * @throws IOException
 */
public static InputStream createBZip2InputStream(final InputStream is) throws IOException {
  return new BZip2Codec().createInputStream(is);
}

Fixed version (ground truth):
/** 
 * Create a bzip2 input stream.
 * @param is input stream
 * @return an uncompressed input stream
 * @throws IOException if an error occurs while creating the input stream
 */
public static InputStream createBZip2InputStream(final InputStream is) throws IOException {
  return new BZip2Codec().createInputStream(is);
}
Program: 141140
Project: 141140
Buggy source:
/** 
 * Create report retrieve by global tests logger.
 * @param duration duration of execution
 * @return report text
 */
private void updateLogger(final String duration){
  String txt="String_Node_Str";
  if (this.nothingToDo) {
    txt+="String_Node_Str" + this.it.getTestName();
  }
 else {
    txt+=(isSuccess() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + this.it.getTestName()+ ((isGeneratedData()) ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ duration;
    if (!isSuccess()) {
      txt+=createExceptionText(false);
    }
  }
  getLogger().info(txt);
}

Fixed version (ground truth):
/** 
 * Create report retrieve by global tests logger.
 * @param duration duration of execution
 */
private void updateLogger(final String duration){
  String txt="String_Node_Str";
  if (this.nothingToDo) {
    txt+="String_Node_Str" + this.it.getTestName();
  }
 else {
    txt+=(isSuccess() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + this.it.getTestName()+ ((isGeneratedData()) ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ duration;
    if (!isSuccess()) {
      txt+=createExceptionText(false);
    }
  }
  getLogger().info(txt);
}
Program: 141141
Project: 141141
Buggy source:
/** 
 * Create the path to the serialized annotation index.
 * @param context Eoulsan context
 * @param featureAnnotationData feature annotation data
 * @return an Hadoop path with the path of the serialized annotation
 * @throws IOException
 */
private static Path getAnnotationIndexSerializedPath(final DataFile featureAnnotationFile) throws IOException {
  final DataFile file=new DataFile(featureAnnotationFile.getParent(),featureAnnotationFile.getBasename() + SERIALIZATION_EXTENSION);
  return new Path(file.getSource());
}

Fixed version (ground truth):
/** 
 * Create the path to the serialized annotation index.
 * @param featureAnnotationFile feature annotation file
 * @return an Hadoop path with the path of the serialized annotation
 * @throws IOException if an error occurs while getting the path
 */
private static Path getAnnotationIndexSerializedPath(final DataFile featureAnnotationFile) throws IOException {
  final DataFile file=new DataFile(featureAnnotationFile.getParent(),featureAnnotationFile.getBasename() + SERIALIZATION_EXTENSION);
  return new Path(file.getSource());
}
Program: 141143
Project: 141143
Buggy source:
/** 
 * Convert command tag from tool file in string, variable are replace by value.
 * @param inputData the input data
 * @param outputData the output data
 * @return the string
 * @throws EoulsanException the Eoulsan exception
 * @throws IOException
 */
ToolExecutorResult execute(final StepContext context) throws EoulsanException ;

Fixed version (ground truth):
/** 
 * Convert command tag from tool file in string, variable are replace by value.
 * @param context Step context
 * @return the string
 * @throws EoulsanException the Eoulsan exception
 */
ToolExecutorResult execute(final StepContext context) throws EoulsanException ;
Program: 141144
Project: 141144
Buggy source:
/** 
 * Comparison parameters xml variables command.
 * @param toolInterpreter TODO
 * @param parametersXML the parameters xml
 * @return the map
 * @throws EoulsanException the eoulsan exception
 */
private Map<String,String> compareVariablesFromXMLToCommand() throws EoulsanException {
  final Map<String,String> results=new HashMap<>();
  for (  final String variableName : getVariableNames()) {
    if (this.variablesCommand.get(variableName) == null) {
      results.put(variableName,DEFAULT_VALUE_NULL);
    }
  }
  return Collections.unmodifiableMap(results);
}

Fixed version (ground truth):
/** 
 * Comparison parameters xml variables command.
 * @return the map
 * @throws EoulsanException the eoulsan exception
 */
private Map<String,String> compareVariablesFromXMLToCommand() throws EoulsanException {
  final Map<String,String> results=new HashMap<>();
  for (  final String variableName : getVariableNames()) {
    if (this.variablesCommand.get(variableName) == null) {
      results.put(variableName,DEFAULT_VALUE_NULL);
    }
  }
  return Collections.unmodifiableMap(results);
}
Program: 141145
Project: 141145
Buggy source:
/** 
 * Translate command xml in python.
 * @param cmdTag the content command tag.
 * @throws EoulsanException if the translation fails.
 */
private void translateCommandXMLInPython() throws EoulsanException {
  if (isCommandLineTranslate) {
    return;
  }
  this.pythonScriptWithJavaCode=translator.getTranslatedCommandInPython();
  isCommandLineTranslate=true;
}

Fixed version (ground truth):
/** 
 * Translate command xml in python.
 * @throws EoulsanException if the translation fails.
 */
private void translateCommandXMLInPython() throws EoulsanException {
  if (isCommandLineTranslate) {
    return;
  }
  this.pythonScriptWithJavaCode=translator.getTranslatedCommandInPython();
  isCommandLineTranslate=true;
}
Program: 141146
Project: 141146
Buggy source:
/** 
 * Instantiates a new translator string to script Python.
 * @param string the raw command tag
 * @throws EoulsanException occurs if translation fail.
 */
TranslatorStringToPython(final String cmdTag) throws EoulsanException {
  Preconditions.checkNotNull(cmdTag,"String_Node_Str");
  this.rawCommand=NEW_LINE.splitToList(cmdTag);
  this.variableNames=Sets.newHashSet();
  this.translatedCommand=translate();
  Preconditions.checkNotNull(translatedCommand,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Instantiates a new translator string to script Python.
 * @param cmdTag the raw command tag
 * @throws EoulsanException occurs if translation fail.
 */
TranslatorStringToPython(final String cmdTag) throws EoulsanException {
  Preconditions.checkNotNull(cmdTag,"String_Node_Str");
  this.rawCommand=NEW_LINE.splitToList(cmdTag);
  this.variableNames=Sets.newHashSet();
  this.translatedCommand=translate();
  Preconditions.checkNotNull(translatedCommand,"String_Node_Str");
}
Program: 141147
Project: 141147
Buggy source:
/** 
 * Extract parameter by name.
 * @param stepParameters
 * @return the parameter found or null.
 */
Parameter extractParameterByName(final Map<String,Parameter> stepParameters);

Fixed version (ground truth):
/** 
 * Extract parameter by name.
 * @param stepParameters step parameters
 * @return the parameter found or null.
 */
Parameter extractParameterByName(final Map<String,Parameter> stepParameters);
Program: 141149
Project: 141149
Buggy source:
/** 
 * Unzip a zip file in a directory.
 * @param zipFile
 * @param outputDirectory
 * @throws IOException
 */
public static void unzip(final File zipFile,final File outputDirectory) throws IOException {
  if (zipFile == null) {
    throw new IOException("String_Node_Str");
  }
  if (!(zipFile.exists() && zipFile.isFile())) {
    throw new IOException("String_Node_Str" + zipFile.getName() + "String_Node_Str");
  }
  unzip(new FileInputStream(zipFile),outputDirectory);
}

Fixed version (ground truth):
/** 
 * Unzip a zip file in a directory.
 * @param zipFile The zip file
 * @param outputDirectory The output directory
 * @throws IOException if an issue occurs while unzipping the file
 */
public static void unzip(final File zipFile,final File outputDirectory) throws IOException {
  if (zipFile == null) {
    throw new IOException("String_Node_Str");
  }
  if (!(zipFile.exists() && zipFile.isFile())) {
    throw new IOException("String_Node_Str" + zipFile.getName() + "String_Node_Str");
  }
  unzip(new FileInputStream(zipFile),outputDirectory);
}
Program: 141150
Project: 141150
Buggy source:
/** 
 * Wait the completion of a collection of jobs.
 * @param jobs Collection of jobs to submit
 * @param waitTimeInMillis waiting time between 2 checks of the completion ofjobs
 * @throws IOException if an IO error occurs while waiting for jobs
 * @throws InterruptedException if an error occurs while waiting for jobs
 * @throws ClassNotFoundException if a class needed for map reduce executionis not found
 */
public static void waitForJobs(final Collection<Job> jobs,final int waitTimeInMillis) throws InterruptedException, IOException {
  if (jobs == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final int totalJobs=jobs.size();
  int completedJobs=0;
  while (completedJobs != totalJobs) {
    Thread.sleep(waitTimeInMillis);
    completedJobs=0;
    for (    Job j : jobs) {
      if (j.isComplete()) {
        completedJobs++;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Wait the completion of a collection of jobs.
 * @param jobs Collection of jobs to submit
 * @param waitTimeInMillis waiting time between 2 checks of the completion ofjobs
 * @throws IOException if an IO error occurs while waiting for jobs
 * @throws InterruptedException if an error occurs while waiting for jobs
 */
public static void waitForJobs(final Collection<Job> jobs,final int waitTimeInMillis) throws InterruptedException, IOException {
  if (jobs == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final int totalJobs=jobs.size();
  int completedJobs=0;
  while (completedJobs != totalJobs) {
    Thread.sleep(waitTimeInMillis);
    completedJobs=0;
    for (    Job j : jobs) {
      if (j.isComplete()) {
        completedJobs++;
      }
    }
  }
}
Program: 141151
Project: 141151
Buggy source:
/** 
 * Destroy the connection to the Rserve server
 * @throws REngineException if an error occurs while deleting to Rserve
 */
void disConnect();

Fixed version (ground truth):
/** 
 * Destroy the connection to the Rserve server
 */
void disConnect();
Program: 141152
Project: 141152
Buggy source:
/** 
 * Open a file to read on Rserve server
 * @param filename
 * @return file
 * @throws REngineException
 */
public RFileInputStream openFile(final String filename) throws REngineException {
  final RConnection connection=getRConnection();
  RFileInputStream file;
  try {
    file=this.rconnection.openFile(filename);
  }
 catch (  IOException e) {
    throw new REngineException(connection,"String_Node_Str");
  }
  return file;
}

Fixed version (ground truth):
/** 
 * Open a file to read on Rserve server
 * @param filename the filename
 * @return an input stream
 * @throws REngineException if an error occurs while creating the input stream
 */
public RFileInputStream openFile(final String filename) throws REngineException {
  final RConnection connection=getRConnection();
  RFileInputStream file;
  try {
    file=this.rconnection.openFile(filename);
  }
 catch (  IOException e) {
    throw new REngineException(connection,"String_Node_Str");
  }
  return file;
}
Program: 141153
Project: 141153
Buggy source:
@Override public void delete(final DataFile file,final boolean recursive) throws IOException {
  final Path path=getSourceAsFile(file).toPath();
  if (new File("String_Node_Str").equals(path.normalize().toAbsolutePath())) {
    new IOException("String_Node_Str" + file);
  }
  if (!(recursive && Files.isDirectory(path,LinkOption.NOFOLLOW_LINKS))) {
    Files.delete(path);
    return;
  }
  Files.walkFileTree(path,new SimpleFileVisitor<Path>(){
    @Override public FileVisitResult visitFile(    Path file,    BasicFileAttributes attrs) throws IOException {
      Files.delete(file);
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult postVisitDirectory(    Path dir,    IOException e) throws IOException {
      Files.delete(dir);
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult visitFileFailed(    Path file,    IOException e) throws IOException {
      throw new IOException("String_Node_Str" + file);
    }
  }
);
}

Fixed version (ground truth):
@Override public void delete(final DataFile file,final boolean recursive) throws IOException {
  final Path path=getSourceAsFile(file).toPath();
  if (new File("String_Node_Str").toPath().equals(path.normalize().toAbsolutePath())) {
    throw new IOException("String_Node_Str" + file);
  }
  if (!(recursive && Files.isDirectory(path,LinkOption.NOFOLLOW_LINKS))) {
    Files.delete(path);
    return;
  }
  Files.walkFileTree(path,new SimpleFileVisitor<Path>(){
    @Override public FileVisitResult visitFile(    Path file,    BasicFileAttributes attrs) throws IOException {
      Files.delete(file);
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult postVisitDirectory(    Path dir,    IOException e) throws IOException {
      Files.delete(dir);
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult visitFileFailed(    Path file,    IOException e) throws IOException {
      throw new IOException("String_Node_Str" + file);
    }
  }
);
}
Program: 141154
Project: 141154
Buggy source:
/** 
 * Compute the md5 sum of a file.
 * @param file the file
 * @return a string with the md5sum of a file
 * @throws IOException if an error occurs while computing the md5sum
 */
private static final String computeMD5SumFile(File file) throws IOException {
  MessageDigest md5Digest;
  try {
    md5Digest=MessageDigest.getInstance("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    md5Digest=null;
  }
  try (InputStream is=new FileInputStream(file)){
    new DigestInputStream(is,md5Digest);
  }
   return new BigInteger(1,md5Digest.digest()).toString(16);
}

Fixed version (ground truth):
/** 
 * Compute the md5 sum of a file.
 * @param file the file
 * @return a string with the md5sum of a file
 * @throws IOException if an error occurs while computing the md5sum
 */
private static final String computeMD5SumFile(File file) throws IOException {
  MessageDigest md5Digest;
  try {
    md5Digest=MessageDigest.getInstance("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    throw new IOException(e);
  }
  try (InputStream is=new FileInputStream(file)){
    new DigestInputStream(is,md5Digest);
  }
   return new BigInteger(1,md5Digest.digest()).toString(16);
}
Program: 141155
Project: 141155
Buggy source:
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=install(MAPPER_EXECUTABLE);
    }
    final File tempDir=File.createTempFile("String_Node_Str","String_Node_Str");
    tempDir.delete();
    tempDir.mkdir();
    final ProcessBuilder pb=new ProcessBuilder(execPath);
    pb.directory(tempDir);
    final Process p=pb.start();
    p.waitFor();
    final File logFile=new File(tempDir,"String_Node_Str");
    String version=null;
    try (BufferedReader reader=Files.newReader(logFile,Globals.DEFAULT_CHARSET)){
      final String line=reader.readLine();
      if (line != null && line.indexOf('=') != -1) {
        version=line.substring(line.indexOf('=') + 1).trim();
        if (version.startsWith("String_Node_Str")) {
          version=version.substring("String_Node_Str".length());
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      return null;
    }
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    logFile.delete();
    tempDir.delete();
    return version;
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
catch (  InterruptedException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=install(MAPPER_EXECUTABLE);
    }
    final File tempDir=File.createTempFile("String_Node_Str","String_Node_Str");
    if (!(tempDir.delete() && tempDir.mkdir())) {
      EoulsanLogger.getLogger().warning("String_Node_Str" + tempDir);
      return null;
    }
    final ProcessBuilder pb=new ProcessBuilder(execPath);
    pb.directory(tempDir);
    final Process p=pb.start();
    p.waitFor();
    final File logFile=new File(tempDir,"String_Node_Str");
    String version=null;
    try (BufferedReader reader=Files.newReader(logFile,Globals.DEFAULT_CHARSET)){
      final String line=reader.readLine();
      if (line != null && line.indexOf('=') != -1) {
        version=line.substring(line.indexOf('=') + 1).trim();
        if (version.startsWith("String_Node_Str")) {
          version=version.substring("String_Node_Str".length());
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      return null;
    }
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    logFile.delete();
    tempDir.delete();
    return version;
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
catch (  InterruptedException e) {
    e.printStackTrace();
    return null;
  }
}
Program: 141156
Project: 141156
Buggy source:
@Override protected void clean(){
  outputFile.delete();
  unmapFile.delete();
}

Fixed version (ground truth):
@Override protected void clean(){
  if (!outputFile.delete()) {
    getLogger().warning("String_Node_Str" + outputFile);
  }
  if (!unmapFile.delete()) {
    getLogger().warning("String_Node_Str" + unmapFile);
  }
}
Program: 141157
Project: 141157
Buggy source:
private MapperProcess createMapperProcessSE(final String soapPath,final String archivePath,final File readsFile,final File outputFile,final File unmapFile,final GenomeDescription genomeDescription,final boolean fileMode) throws IOException {
  return new MapperProcess(this,fileMode,false,false){
    @Override protected List<List<String>> createCommandLines(){
      final List<String> cmd=new ArrayList<String>();
      cmd.add(soapPath);
      if (getListMapperArguments() != null)       cmd.addAll(getListMapperArguments());
      cmd.add("String_Node_Str");
      cmd.add(getThreadsNumber() + "String_Node_Str");
      cmd.add("String_Node_Str");
      if (fileMode)       cmd.add(readsFile.getAbsolutePath());
 else       cmd.add(getTmpInputFile1().getAbsolutePath());
      cmd.add("String_Node_Str");
      cmd.add(archivePath);
      cmd.add("String_Node_Str");
      cmd.add(outputFile.getAbsolutePath());
      cmd.add("String_Node_Str");
      cmd.add(unmapFile.getAbsolutePath());
      return Collections.singletonList(cmd);
    }
    @Override protected InputStream createCustomInputStream(    InputStream stdout) throws FileNotFoundException {
      return new SequenceInputStream(convertSOAP2SAM(stdout,genomeDescription,isPairedEnd()),convertFasta2SAM(new FileInputStream(unmapFile)));
    }
    @Override protected void clean(){
      outputFile.delete();
      unmapFile.delete();
    }
  }
;
}

Fixed version (ground truth):
private MapperProcess createMapperProcessSE(final String soapPath,final String archivePath,final File readsFile,final File outputFile,final File unmapFile,final GenomeDescription genomeDescription,final boolean fileMode) throws IOException {
  return new MapperProcess(this,fileMode,false,false){
    @Override protected List<List<String>> createCommandLines(){
      final List<String> cmd=new ArrayList<String>();
      cmd.add(soapPath);
      if (getListMapperArguments() != null)       cmd.addAll(getListMapperArguments());
      cmd.add("String_Node_Str");
      cmd.add(getThreadsNumber() + "String_Node_Str");
      cmd.add("String_Node_Str");
      if (fileMode)       cmd.add(readsFile.getAbsolutePath());
 else       cmd.add(getTmpInputFile1().getAbsolutePath());
      cmd.add("String_Node_Str");
      cmd.add(archivePath);
      cmd.add("String_Node_Str");
      cmd.add(outputFile.getAbsolutePath());
      cmd.add("String_Node_Str");
      cmd.add(unmapFile.getAbsolutePath());
      return Collections.singletonList(cmd);
    }
    @Override protected InputStream createCustomInputStream(    InputStream stdout) throws FileNotFoundException {
      return new SequenceInputStream(convertSOAP2SAM(stdout,genomeDescription,isPairedEnd()),convertFasta2SAM(new FileInputStream(unmapFile)));
    }
    @Override protected void clean(){
      if (!outputFile.delete()) {
        getLogger().warning("String_Node_Str" + outputFile);
      }
      if (!unmapFile.delete()) {
        getLogger().warning("String_Node_Str" + unmapFile);
      }
    }
  }
;
}
Program: 141159
Project: 141159
Buggy source:
@Override public String getMapperVersion(){
  try {
    final String gsnapPath;
synchronized (SYNC) {
      gsnapPath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=gsnapPath + "String_Node_Str";
    final String s=ProcessUtils.execToString(cmd);
    if (s == null)     return null;
    final String[] lines=s.split("String_Node_Str");
    if (lines.length == 0)     return null;
    final String[] tokens=lines[2].split("String_Node_Str");
    if (tokens.length == 2)     return tokens[1];
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}

Fixed version (ground truth):
@Override public String getMapperVersion(){
  try {
    final String gsnapPath;
synchronized (SYNC) {
      gsnapPath=install(MAPPER_EXECUTABLE);
    }
    final String cmd=gsnapPath + "String_Node_Str";
    final String s=ProcessUtils.execToString(cmd);
    final String[] lines=s.split("String_Node_Str");
    if (lines.length == 0)     return null;
    final String[] tokens=lines[2].split("String_Node_Str");
    if (tokens.length == 2)     return tokens[1];
    return null;
  }
 catch (  IOException e) {
    return null;
  }
}
Program: 141160
Project: 141160
Buggy source:
/** 
 * Constructor.
 * @param step step related to the context
 */
TaskContext(final WorkflowContext workflowContext,final AbstractWorkflowStep step,Map<InputPort,Data> inputData,Map<OutputPort,AbstractData> outputData){
  checkNotNull(workflowContext,"String_Node_Str");
  checkNotNull(step,"String_Node_Str");
synchronized (this.getClass()) {
    this.id=(++instanceCounter);
  }
  this.contextName="String_Node_Str" + id;
  this.workflowContext=workflowContext;
  this.step=step;
  for (  Map.Entry<InputPort,Data> e : inputData.entrySet()) {
    this.inputData.put(e.getKey().getName(),e.getValue());
  }
  for (  Map.Entry<OutputPort,AbstractData> e : outputData.entrySet()) {
    this.outputData.put(e.getKey().getName(),e.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param step step related to the context
 */
TaskContext(final WorkflowContext workflowContext,final AbstractWorkflowStep step,Map<InputPort,Data> inputData,Map<OutputPort,AbstractData> outputData){
  checkNotNull(workflowContext,"String_Node_Str");
  checkNotNull(step,"String_Node_Str");
synchronized (TaskContext.class) {
    this.id=(++instanceCounter);
  }
  this.contextName="String_Node_Str" + id;
  this.workflowContext=workflowContext;
  this.step=step;
  for (  Map.Entry<InputPort,Data> e : inputData.entrySet()) {
    this.inputData.put(e.getKey().getName(),e.getValue());
  }
  for (  Map.Entry<OutputPort,AbstractData> e : outputData.entrySet()) {
    this.outputData.put(e.getKey().getName(),e.getValue());
  }
}
Program: 141163
Project: 141163
Buggy source:
private boolean fillBuffer(final int minSize) throws IOException {
  final int finalPos=this.pos + minSize;
  if (finalPos < this.buffer.length)   return false;
  if (this.endStream)   return true;
  this.sb.setLength(0);
  this.sb.append(new String(this.buffer,this.pos,this.buffer.length - this.pos));
  do {
    String line=this.reader.readLine();
    final List<String> lines;
    if (line == null) {
      lines=transform(null);
      this.endStream=true;
    }
 else {
      lines=transform(line);
    }
    if (lines != null)     for (    String l : lines) {
      this.sb.append(l);
      this.sb.append('\n');
    }
  }
 while (sb.length() < minSize || this.endStream);
  this.buffer=this.sb.toString().getBytes(CHARSET);
  this.pos=0;
  return false;
}

Fixed version (ground truth):
private boolean fillBuffer(final int minSize) throws IOException {
  final int finalPos=this.pos + minSize;
  if (finalPos < this.buffer.length)   return false;
  if (this.endStream)   return true;
  this.sb.setLength(0);
  this.sb.append(new String(this.buffer,this.pos,this.buffer.length - this.pos,Globals.DEFAULT_CHARSET));
  do {
    String line=this.reader.readLine();
    final List<String> lines;
    if (line == null) {
      lines=transform(null);
      this.endStream=true;
    }
 else {
      lines=transform(line);
    }
    if (lines != null)     for (    String l : lines) {
      this.sb.append(l);
      this.sb.append('\n');
    }
  }
 while (sb.length() < minSize || this.endStream);
  this.buffer=this.sb.toString().getBytes(CHARSET);
  this.pos=0;
  return false;
}
Program: 141164
Project: 141164
Buggy source:
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=install(MAPPER_EXECUTABLE);
    }
    final File tempDir=File.createTempFile("String_Node_Str","String_Node_Str");
    tempDir.delete();
    tempDir.mkdir();
    final ProcessBuilder pb=new ProcessBuilder(execPath);
    pb.directory(tempDir);
    final Process p=pb.start();
    p.waitFor();
    final File logFile=new File(tempDir,"String_Node_Str");
    String version=null;
    try (BufferedReader reader=new BufferedReader(new FileReader(logFile))){
      final String line=reader.readLine();
      if (line != null && line.indexOf('=') != -1) {
        version=line.substring(line.indexOf('=') + 1).trim();
        if (version.startsWith("String_Node_Str")) {
          version=version.substring("String_Node_Str".length());
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      return null;
    }
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    logFile.delete();
    tempDir.delete();
    return version;
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
catch (  InterruptedException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
@Override public String getMapperVersion(){
  try {
    final String execPath;
synchronized (SYNC) {
      execPath=install(MAPPER_EXECUTABLE);
    }
    final File tempDir=File.createTempFile("String_Node_Str","String_Node_Str");
    tempDir.delete();
    tempDir.mkdir();
    final ProcessBuilder pb=new ProcessBuilder(execPath);
    pb.directory(tempDir);
    final Process p=pb.start();
    p.waitFor();
    final File logFile=new File(tempDir,"String_Node_Str");
    String version=null;
    try (BufferedReader reader=Files.newReader(logFile,Globals.DEFAULT_CHARSET)){
      final String line=reader.readLine();
      if (line != null && line.indexOf('=') != -1) {
        version=line.substring(line.indexOf('=') + 1).trim();
        if (version.startsWith("String_Node_Str")) {
          version=version.substring("String_Node_Str".length());
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      return null;
    }
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    new File(tempDir,"String_Node_Str").delete();
    logFile.delete();
    tempDir.delete();
    return version;
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
catch (  InterruptedException e) {
    e.printStackTrace();
    return null;
  }
}
Program: 141165
Project: 141165
Buggy source:
/** 
 * Load metadata.
 * @throws EoulsanException if an error occurs while reading metadata
 */
private void loadMetaDataEntries() throws EoulsanException {
  if (!this.metadataFile.exists()) {
    return;
  }
  try (BufferedReader reader=new BufferedReader(new InputStreamReader(this.metadataFile.open()))){
    String line=null;
    while ((line=reader.readLine()) != null) {
      final String[] fields=line.split(FIELD_SEPARATOR);
      if (fields.length % 2 != 0) {
        final String filename=fields[0];
        final Map<String,String> entries=new HashMap<>();
        this.metadata.put(filename,entries);
        for (int i=1; i < fields.length; i+=2) {
          entries.put(fields[i],fields[i + 1]);
        }
      }
    }
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Load metadata.
 * @throws EoulsanException if an error occurs while reading metadata
 */
private void loadMetaDataEntries() throws EoulsanException {
  if (!this.metadataFile.exists()) {
    return;
  }
  try (BufferedReader reader=new BufferedReader(new InputStreamReader(this.metadataFile.open(),Globals.DEFAULT_CHARSET))){
    String line=null;
    while ((line=reader.readLine()) != null) {
      final String[] fields=line.split(FIELD_SEPARATOR);
      if (fields.length % 2 != 0) {
        final String filename=fields[0];
        final Map<String,String> entries=new HashMap<>();
        this.metadata.put(filename,entries);
        for (int i=1; i < fields.length; i+=2) {
          entries.put(fields[i],fields[i + 1]);
        }
      }
    }
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
}
Program: 141166
Project: 141166
Buggy source:
private void writeMetadataEntry(final String s) throws EoulsanException {
  if (!this.metadataFile.isLocalFile()) {
    return;
  }
  try (PrintWriter out=new PrintWriter(new BufferedWriter(new FileWriter(this.metadataFile.toFile(),true)))){
    out.println(s);
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
private void writeMetadataEntry(final String s) throws EoulsanException {
  if (!this.metadataFile.isLocalFile()) {
    return;
  }
  try (PrintWriter out=new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.metadataFile.toFile(),true),Globals.DEFAULT_CHARSET))){
    out.println(s);
  }
 catch (  IOException e) {
    throw new EoulsanException("String_Node_Str" + e.getMessage());
  }
}
Program: 141167
Project: 141167
Buggy source:
/** 
 * Build BloomFilter represented the input stream.
 * @param is the input stream source
 * @return BloomFilter corresponding to the input stream
 * @throws IOException
 */
protected BloomFilterUtils buildBloomFilter(InputStream is) throws IOException {
  final BloomFilterUtils filter=initBloomFilter(getExpectedNumberOfElements());
  final BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  String line=null;
  while ((line=reader.readLine()) != null) {
    filter.put(line);
  }
  reader.close();
  return filter;
}

Fixed version (ground truth):
/** 
 * Build BloomFilter represented the input stream.
 * @param is the input stream source
 * @return BloomFilter corresponding to the input stream
 * @throws IOException
 */
protected BloomFilterUtils buildBloomFilter(InputStream is) throws IOException {
  final BloomFilterUtils filter=initBloomFilter(getExpectedNumberOfElements());
  final BufferedReader reader=new BufferedReader(new InputStreamReader(is,Globals.DEFAULT_CHARSET));
  String line=null;
  while ((line=reader.readLine()) != null) {
    filter.put(line);
  }
  reader.close();
  return filter;
}
Program: 141168
Project: 141168
Buggy source:
@Override public boolean compareFiles(BloomFilterUtils filter,InputStream is) throws IOException {
  final BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  String line=null;
  numberElementsCompared=0;
  while ((line=reader.readLine()) != null) {
    numberElementsCompared++;
    if (line.charAt(0) == '@') {
      if (!this.tagsToNotCompare.contains(getTag(line))) {
        if (!filter.mightContain(line)) {
          setCauseFailComparison(line);
          reader.close();
          return false;
        }
      }
    }
 else {
      if (!filter.mightContain(line)) {
        setCauseFailComparison(line);
        reader.close();
        return false;
      }
    }
  }
  reader.close();
  if (this.numberElementsCompared != filter.getAddedNumberOfElements()) {
    setCauseFailComparison("String_Node_Str" + this.numberElementsCompared + "String_Node_Str"+ filter.getAddedNumberOfElements()+ "String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean compareFiles(BloomFilterUtils filter,InputStream is) throws IOException {
  final BufferedReader reader=new BufferedReader(new InputStreamReader(is,Globals.DEFAULT_CHARSET));
  String line=null;
  numberElementsCompared=0;
  while ((line=reader.readLine()) != null) {
    numberElementsCompared++;
    if (line.charAt(0) == '@') {
      if (!this.tagsToNotCompare.contains(getTag(line))) {
        if (!filter.mightContain(line)) {
          setCauseFailComparison(line);
          reader.close();
          return false;
        }
      }
    }
 else {
      if (!filter.mightContain(line)) {
        setCauseFailComparison(line);
        reader.close();
        return false;
      }
    }
  }
  reader.close();
  if (this.numberElementsCompared != filter.getAddedNumberOfElements()) {
    setCauseFailComparison("String_Node_Str" + this.numberElementsCompared + "String_Node_Str"+ filter.getAddedNumberOfElements()+ "String_Node_Str");
    return false;
  }
  return true;
}