nus-yam/ex-repair huggingface dataset:
Program: 141024
Project: 141024
Buggy source:
/** 
 * Check temporary directory.
 * @throws EoulsanException
 */
private void checkTemporaryDirectory() throws EoulsanException {
  final File tempDir=EoulsanRuntime.getSettings().getTempDirectoryFile();
  if (tempDir == null) {
    throw new EoulsanException("String_Node_Str");
  }
  if ("String_Node_Str".equals(tempDir.getAbsolutePath())) {
    throw new EoulsanException("String_Node_Str");
  }
  if (!tempDir.exists()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.isDirectory()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.canRead()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.canWrite()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.canExecute()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
}

Fixed version (ground truth):
/** 
 * Check temporary directory.
 * @throws EoulsanException if the checking of the temporary directory fails
 */
private void checkTemporaryDirectory() throws EoulsanException {
  final File tempDir=EoulsanRuntime.getSettings().getTempDirectoryFile();
  if (tempDir == null) {
    throw new EoulsanException("String_Node_Str");
  }
  if ("String_Node_Str".equals(tempDir.getAbsolutePath())) {
    throw new EoulsanException("String_Node_Str");
  }
  if (!tempDir.exists()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.isDirectory()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.canRead()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.canWrite()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
  if (!tempDir.canExecute()) {
    throw new EoulsanException("String_Node_Str" + tempDir);
  }
}
Program: 141025
Project: 141025
Buggy source:
/** 
 * Public constructor.
 * @param executionArguments execution arguments
 * @param workflowCommand Command object with the content of the parameterfile
 * @param firstSteps optional steps to add at the beginning of the workflow
 * @param endSteps optional steps to add at the end of the workflow
 * @param design Design to use with the workflow
 * @throws EoulsanException
 */
public CommandWorkflow(final ExecutorArguments executionArguments,final CommandWorkflowModel workflowCommand,final List<Module> firstSteps,final List<Module> endSteps,final Design design) throws EoulsanException {
  super(executionArguments,design);
  if (workflowCommand == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.workflowCommand=workflowCommand;
  final WorkflowContext context=getWorkflowContext();
  context.setCommandName(workflowCommand.getName());
  context.setCommandDescription(workflowCommand.getDescription());
  context.setCommandAuthor(workflowCommand.getAuthor());
  initializeSettings();
  convertDesignS3URLs();
  addMainSteps();
  addFirstSteps(firstSteps);
  addEndSteps(endSteps);
  configureSteps();
  addManualDependencies();
  searchDependencies();
}

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param executionArguments execution arguments
 * @param workflowCommand Command object with the content of the parameterfile
 * @param firstSteps optional steps to add at the beginning of the workflow
 * @param endSteps optional steps to add at the end of the workflow
 * @param design Design to use with the workflow
 * @throws EoulsanException if the creation of the CommandWorkflow object fails
 */
public CommandWorkflow(final ExecutorArguments executionArguments,final CommandWorkflowModel workflowCommand,final List<Module> firstSteps,final List<Module> endSteps,final Design design) throws EoulsanException {
  super(executionArguments,design);
  if (workflowCommand == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.workflowCommand=workflowCommand;
  final WorkflowContext context=getWorkflowContext();
  context.setCommandName(workflowCommand.getName());
  context.setCommandDescription(workflowCommand.getDescription());
  context.setCommandAuthor(workflowCommand.getAuthor());
  initializeSettings();
  convertDesignS3URLs();
  addMainSteps();
  addFirstSteps(firstSteps);
  addEndSteps(endSteps);
  configureSteps();
  addManualDependencies();
  searchDependencies();
}
Program: 141026
Project: 141026
Buggy source:
/** 
 * Get a OutputTreeType object from the Eoulsan settings.
 * @param type the type
 * @return a OutputTreeType object
 */
public static OutputTreeType getOutputTreeType(){
  return getOutputTreeType(EoulsanRuntime.getSettings().getOutputTreeType());
}

Fixed version (ground truth):
/** 
 * Get a OutputTreeType object from the Eoulsan settings.
 * @return a OutputTreeType object
 */
public static OutputTreeType getOutputTreeType(){
  return getOutputTreeType(EoulsanRuntime.getSettings().getOutputTreeType());
}
Program: 141027
Project: 141027
Buggy source:
/** 
 * Parse the header of the new design file including the informations about the design, the genome, the annotations and the informations about the experiments.
 * @param design the design object
 * @param line the line read from your design file
 * @throws IOException
 */
private void parseHeader(final Design design,final String line) throws IOException {
  final int equalPos=line.indexOf(EQUAL_SEPARATOR);
  if (equalPos == -1) {
    throw new IOException("String_Node_Str");
  }
  final String key=line.substring(0,equalPos).trim();
  final String value=line.substring(equalPos + 1).trim();
  if ("String_Node_Str".equals(key)) {
    throw new IOException("String_Node_Str");
  }
  if ("String_Node_Str".equals(value)) {
    throw new IOException("String_Node_Str");
  }
  if (key.startsWith(EXPERIMENT_FIELD_PREFIX)) {
    readExpMetadata(key,value,design);
  }
 else {
    readDesignMetadata(key,value,design);
  }
}

Fixed version (ground truth):
/** 
 * Parse the header of the new design file including the informations about the design, the genome, the annotations and the informations about the experiments.
 * @param design the design object
 * @param line the line read from your design file
 * @throws IOException if the header parsing fails
 */
private void parseHeader(final Design design,final String line) throws IOException {
  final int equalPos=line.indexOf(EQUAL_SEPARATOR);
  if (equalPos == -1) {
    throw new IOException("String_Node_Str");
  }
  final String key=line.substring(0,equalPos).trim();
  final String value=line.substring(equalPos + 1).trim();
  if ("String_Node_Str".equals(key)) {
    throw new IOException("String_Node_Str");
  }
  if ("String_Node_Str".equals(value)) {
    throw new IOException("String_Node_Str");
  }
  if (key.startsWith(EXPERIMENT_FIELD_PREFIX)) {
    readExpMetadata(key,value,design);
  }
 else {
    readDesignMetadata(key,value,design);
  }
}
Program: 141028
Project: 141028
Buggy source:
/** 
 * Read sample metadata experiment referring to a specific experiment.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sample the sample
 * @throws IOException
 */
private void readExperimentSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  final List<String> expField=GuavaCompatibility.splitToList(this.dotSplitter,columnName);
  if (expField.size() != 3) {
    throw new IOException("String_Node_Str");
  }
  String expId=expField.get(1);
  String expKey=expField.get(2);
  if (!design.containsExperiment(expId)) {
    throw new IOException("String_Node_Str" + expId + "String_Node_Str");
  }
  final Experiment experiment=design.getExperiment(expId);
  if (!experiment.containsSample(sample)) {
    experiment.addSample(sample);
  }
  final ExperimentSample experimentSample=experiment.getExperimentSample(sample);
  final ExperimentSampleMetadata experimentSampleMetadata=experimentSample.getMetadata();
  if (experimentSampleMetadata.contains(expKey)) {
    throw new IOException("String_Node_Str" + expKey + "String_Node_Str");
  }
  experimentSampleMetadata.set(expKey,columnValue);
}

Fixed version (ground truth):
/** 
 * Read sample metadata experiment referring to a specific experiment.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sample the sample
 * @throws IOException if the sample metadata read is incorrect
 */
private void readExperimentSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  final List<String> expField=GuavaCompatibility.splitToList(this.dotSplitter,columnName);
  if (expField.size() != 3) {
    throw new IOException("String_Node_Str");
  }
  String expId=expField.get(1);
  String expKey=expField.get(2);
  if (!design.containsExperiment(expId)) {
    throw new IOException("String_Node_Str" + expId + "String_Node_Str");
  }
  final Experiment experiment=design.getExperiment(expId);
  if (!experiment.containsSample(sample)) {
    experiment.addSample(sample);
  }
  final ExperimentSample experimentSample=experiment.getExperimentSample(sample);
  final ExperimentSampleMetadata experimentSampleMetadata=experimentSample.getMetadata();
  if (experimentSampleMetadata.contains(expKey)) {
    throw new IOException("String_Node_Str" + expKey + "String_Node_Str");
  }
  experimentSampleMetadata.set(expKey,columnValue);
}
Program: 141029
Project: 141029
Buggy source:
/** 
 * Read the design metadata from the header.
 * @param key the key of the design metadata
 * @param value the value of the design metadata
 * @param design the design object
 * @throws IOException
 */
private void readDesignMetadata(String key,String value,Design design) throws IOException {
  if (DESIGN_FORMAT_VERSION_METADATA_KEY.equals(key)) {
    if (!FORMAT_VERSION.equals(value.trim())) {
      throw new IOException("String_Node_Str" + value);
    }
    return;
  }
  if (design.getMetadata().contains(key)) {
    throw new IOException("String_Node_Str" + key + "String_Node_Str");
  }
  design.getMetadata().set(key,value);
}

Fixed version (ground truth):
/** 
 * Read the design metadata from the header.
 * @param key the key of the design metadata
 * @param value the value of the design metadata
 * @param design the design object
 * @throws IOException if design metadata read is incorrect
 */
private void readDesignMetadata(String key,String value,Design design) throws IOException {
  if (DESIGN_FORMAT_VERSION_METADATA_KEY.equals(key)) {
    if (!FORMAT_VERSION.equals(value.trim())) {
      throw new IOException("String_Node_Str" + value);
    }
    return;
  }
  if (design.getMetadata().contains(key)) {
    throw new IOException("String_Node_Str" + key + "String_Node_Str");
  }
  design.getMetadata().set(key,value);
}
Program: 141031
Project: 141031
Buggy source:
/** 
 * Read sample metadata.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sample the sample
 * @throws IOException
 */
private void readSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  if (sample.getMetadata().contains(columnName)) {
    throw new IOException("String_Node_Str" + columnName + "String_Node_Str");
  }
  sample.getMetadata().set(columnName,columnValue);
}

Fixed version (ground truth):
/** 
 * Read sample metadata.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sample the sample
 * @throws IOException if the metadata read is incorrect
 */
private void readSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  if (sample.getMetadata().contains(columnName)) {
    throw new IOException("String_Node_Str" + columnName + "String_Node_Str");
  }
  sample.getMetadata().set(columnName,columnValue);
}
Program: 141032
Project: 141032
Buggy source:
/** 
 * Read the experiment metadata from the header part
 * @param key the key of the experiment metadata read
 * @param value the value of the experiment metadata read
 * @param design the design object
 * @throws IOException
 */
private void readExpMetadata(String key,String value,Design design) throws IOException {
  final List<String> expField=GuavaCompatibility.splitToList(this.dotSplitter,key);
  if (expField.size() != 3) {
    throw new IOException("String_Node_Str");
  }
  String expId=expField.get(1);
  String expKey=expField.get(2);
  if (!design.containsExperiment(expId)) {
    design.addExperiment(expId);
  }
  if (EXPERIMENT_NAME_SUFFIX.equals(expKey)) {
    design.getExperiment(expId).setName(value);
  }
 else {
    if (design.getExperiment(expId).getMetadata().contains(key)) {
      throw new IOException("String_Node_Str" + key + "String_Node_Str"+ expId+ "String_Node_Str");
    }
    design.getExperiment(expId).getMetadata().set(expKey,value);
  }
}

Fixed version (ground truth):
/** 
 * Read the experiment metadata from the header part
 * @param key the key of the experiment metadata read
 * @param value the value of the experiment metadata read
 * @param design the design object
 * @throws IOException if the metadata read is incorrect
 */
private void readExpMetadata(String key,String value,Design design) throws IOException {
  final List<String> expField=GuavaCompatibility.splitToList(this.dotSplitter,key);
  if (expField.size() != 3) {
    throw new IOException("String_Node_Str");
  }
  String expId=expField.get(1);
  String expKey=expField.get(2);
  if (!design.containsExperiment(expId)) {
    design.addExperiment(expId);
  }
  if (EXPERIMENT_NAME_SUFFIX.equals(expKey)) {
    design.getExperiment(expId).setName(value);
  }
 else {
    if (design.getExperiment(expId).getMetadata().contains(key)) {
      throw new IOException("String_Node_Str" + key + "String_Node_Str"+ expId+ "String_Node_Str");
    }
    design.getExperiment(expId).getMetadata().set(expKey,value);
  }
}
Program: 141033
Project: 141033
Buggy source:
/** 
 * Instantiates a new tool Cheetah script interpreter.
 * @param cheetahScript the Cheetah script to execute
 * @param variables the variables of the script
 * @throws EoulsanException
 */
public CheetahInterpreter(final String cheetahScript,final Map<String,String> variables) throws EoulsanException {
  checkNotNull(variables,"String_Node_Str");
  checkState(!variables.isEmpty(),"String_Node_Str");
  this.cheetahScript=cheetahScript;
  this.variables=new HashMap<>(variables);
}

Fixed version (ground truth):
/** 
 * Instantiates a new tool Cheetah script interpreter.
 * @param cheetahScript the Cheetah script to execute
 * @param variables the variables of the script
 * @throws EoulsanException if the constructor fails
 */
public CheetahInterpreter(final String cheetahScript,final Map<String,String> variables) throws EoulsanException {
  checkNotNull(variables,"String_Node_Str");
  checkState(!variables.isEmpty(),"String_Node_Str");
  this.cheetahScript=cheetahScript;
  this.variables=new HashMap<>(variables);
}
Program: 141034
Project: 141034
Buggy source:
/** 
 * Build BloomFilter represented the input stream.
 * @param is the input stream source
 * @return BloomFilter corresponding to the input stream
 * @throws IOException
 */
protected EnhancedBloomFilter buildBloomFilter(final InputStream is) throws IOException {
  final EnhancedBloomFilter 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;
}

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 if bloom filter creation fails
 */
protected EnhancedBloomFilter buildBloomFilter(final InputStream is) throws IOException {
  final EnhancedBloomFilter 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: 141035
Project: 141035
Buggy source:
/** 
 * Method to decode the allowed compressions parameter.
 * @param value the parameter value as a string
 * @return the parameter value as an EnumSet
 * @throws EoulsanException
 */
private static EnumSet<CompressionType> decodeAllowedCompressionsParameterValue(final String value) throws EoulsanException {
  if (value == null) {
    throw new EoulsanException(OUTPUT_COMPRESSIONS_ALLOWED_PARAMETER + "String_Node_Str");
  }
  final Set<CompressionType> result=new HashSet<>();
  for (  String s : Splitter.on('\t').omitEmptyStrings().trimResults().split(value)) {
    final CompressionType compression=CompressionType.valueOf(s);
    if (compression != null) {
      result.add(compression);
    }
  }
  return EnumSet.copyOf(result);
}

Fixed version (ground truth):
/** 
 * Method to decode the allowed compressions parameter.
 * @param value the parameter value as a string
 * @return the parameter value as an EnumSet
 * @throws EoulsanException if the value parameter is null
 */
private static EnumSet<CompressionType> decodeAllowedCompressionsParameterValue(final String value) throws EoulsanException {
  if (value == null) {
    throw new EoulsanException(OUTPUT_COMPRESSIONS_ALLOWED_PARAMETER + "String_Node_Str");
  }
  final Set<CompressionType> result=new HashSet<>();
  for (  String s : Splitter.on('\t').omitEmptyStrings().trimResults().split(value)) {
    final CompressionType compression=CompressionType.valueOf(s);
    if (compression != null) {
      result.add(compression);
    }
  }
  return EnumSet.copyOf(result);
}
Program: 141037
Project: 141037
Buggy source:
/** 
 * Find the resource to load.
 * @param directory the directory where loading the resources
 * @return a list of relative paths
 * @throws IOException
 */
private List<String> findResourcePaths(final DataFile directory) throws IOException {
  final DataFile indexFile=new DataFile(directory,INDEX_FILE);
  if (indexFile.exists()) {
    return findResourcePathInIndexFile(indexFile);
  }
  return findResourcePathInDirectory(directory);
}

Fixed version (ground truth):
/** 
 * Find the resource to load.
 * @param directory the directory where loading the resources
 * @return a list of relative paths
 * @throws IOException if an error occrs while finding the resource
 */
private List<String> findResourcePaths(final DataFile directory) throws IOException {
  final DataFile indexFile=new DataFile(directory,INDEX_FILE);
  if (indexFile.exists()) {
    return findResourcePathInIndexFile(indexFile);
  }
  return findResourcePathInDirectory(directory);
}
Program: 141038
Project: 141038
Buggy source:
/** 
 * Constructor.
 * @param dockerClient Docker connection URI
 * @param dockerImage Docker image
 * @param temporaryDirectory temporary directory
 */
FallBackDockerImageInstance(final String dockerImage){
  checkNotNull(dockerImage,"String_Node_Str");
  this.dockerImage=dockerImage;
  this.userUid=SystemUtils.uid();
  this.userGid=SystemUtils.gid();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param dockerImage Docker image
 */
FallBackDockerImageInstance(final String dockerImage){
  checkNotNull(dockerImage,"String_Node_Str");
  this.dockerImage=dockerImage;
  this.userUid=SystemUtils.uid();
  this.userGid=SystemUtils.gid();
}
Program: 141039
Project: 141039
Buggy source:
/** 
 * Constructor.
 * @param dockerClient Docker connection URI
 * @param dockerImage Docker image
 * @param temporaryDirectory temporary directory
 */
SportifyDockerImageInstance(final DockerClient dockerClient,final String dockerImage){
  checkNotNull(dockerClient,"String_Node_Str");
  checkNotNull(dockerImage,"String_Node_Str");
  this.dockerClient=dockerClient;
  this.dockerImage=dockerImage;
  this.userUid=SystemUtils.uid();
  this.userGid=SystemUtils.gid();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param dockerClient Docker connection URI
 * @param dockerImage Docker image
 */
SportifyDockerImageInstance(final DockerClient dockerClient,final String dockerImage){
  checkNotNull(dockerClient,"String_Node_Str");
  checkNotNull(dockerImage,"String_Node_Str");
  this.dockerClient=dockerClient;
  this.dockerImage=dockerImage;
  this.userUid=SystemUtils.uid();
  this.userGid=SystemUtils.gid();
}
Program: 141040
Project: 141040
Buggy source:
/** 
 * Remove a file of the analysis.
 * @param filename the filename of the file to remove
 * @throws IOException
 */
protected abstract void removeFile(String filename) throws IOException ;

Fixed version (ground truth):
/** 
 * Remove a file of the analysis.
 * @param filename the filename of the file to remove
 * @throws IOException if the removing of the file fails
 */
protected abstract void removeFile(String filename) throws IOException ;
Program: 141041
Project: 141041
Buggy source:
@Override public void close(){
synchronized (this) {
    if (client != null) {
      client.close();
      this.close();
    }
  }
}

Fixed version (ground truth):
@Override public void close(){
synchronized (this) {
    if (client != null) {
      this.client.close();
    }
  }
}
Program: 141043
Project: 141043
Buggy source:
/** 
 * Create an ArrayList Object.
 * @param elements to add at the creation of the list
 * @return a new ArrayList object
 */
public static <E>List<E> newArrayList(final Collection<? extends E> elements){
  return new ArrayList<>(elements);
}

Fixed version (ground truth):
/** 
 * Create an ArrayList Object.
 * @param elements to add at the creation of the list
 * @return a new ArrayList object
 */
public static <E>List<E> newArrayList(final Collection<? extends E> elements){
  return new ArrayList<E>(elements);
}
Program: 141044
Project: 141044
Buggy source:
/** 
 * Create a HashSet Object.
 * @param elements to add at the creation of the set
 * @return a new HashSet object
 */
public static <E>HashSet<E> newHashSet(final Collection<? extends E> elements){
  return new HashSet<>(elements);
}

Fixed version (ground truth):
/** 
 * Create a HashSet Object.
 * @param elements to add at the creation of the set
 * @return a new HashSet object
 */
public static <E>HashSet<E> newHashSet(final Collection<? extends E> elements){
  return new HashSet<E>(elements);
}
Program: 141045
Project: 141045
Buggy source:
@Test public void test(){
  Design d=new Design();
  d.addExperiment("String_Node_Str");
  ExperimentMetadata em=d.getExperiment("String_Node_Str").getMetadata();
  assertFalse(em.containsSkip());
  em.setSkip(false);
  assertTrue(em.containsSkip());
  assertFalse(em.isSkip());
  em.setSkip(true);
  assertTrue(em.isSkip());
  assertTrue(em.containsSkip());
  assertNull(em.getReference());
  em.setReference("String_Node_Str");
  assertEquals("String_Node_Str",em.getReference());
  assertTrue(em.containsReference());
  assertNull(em.getModel());
  em.setModel("String_Node_Str");
  assertEquals("String_Node_Str",em.getModel());
  assertTrue(em.containsModel());
  assertFalse(em.containsContrast());
  em.setContrast(true);
  assertEquals(true,em.isContrast());
  assertTrue(em.containsContrast());
  assertFalse(em.containsBuildContrast());
  em.setBuildContrast(true);
  assertTrue(em.isBuildContrast());
  assertTrue(em.containsBuildContrast());
  assertNull(em.getDesignFile());
  em.setDesignFile("String_Node_Str");
  assertEquals("String_Node_Str",em.getDesignFile());
  assertTrue(em.containsDesignFile());
  assertNull(em.getComparison());
  em.setComparisons("String_Node_Str");
  assertEquals("String_Node_Str",em.getComparison());
  assertTrue(em.containsComparisons());
  assertNull(em.getContrastFile());
  em.setContrastFile("String_Node_Str");
  assertEquals("String_Node_Str",em.getContrastFile());
  assertTrue(em.containsContrastFile());
}

Fixed version (ground truth):
@Test public void test(){
  Design d=new Design();
  d.addExperiment("String_Node_Str");
  ExperimentMetadata em=d.getExperiment("String_Node_Str").getMetadata();
  assertFalse(em.containsSkip());
  em.setSkip(false);
  assertTrue(em.containsSkip());
  assertFalse(em.isSkip());
  em.setSkip(true);
  assertTrue(em.isSkip());
  assertTrue(em.containsSkip());
  assertNull(em.getReference());
  em.setReference("String_Node_Str");
  assertEquals("String_Node_Str",em.getReference());
  assertTrue(em.containsReference());
  assertNull(em.getModel());
  em.setModel("String_Node_Str");
  assertEquals("String_Node_Str",em.getModel());
  assertTrue(em.containsModel());
  assertFalse(em.containsContrast());
  em.setContrast(true);
  assertEquals(true,em.isContrast());
  assertTrue(em.containsContrast());
  assertFalse(em.containsBuildContrast());
  em.setBuildContrast(true);
  assertTrue(em.isBuildContrast());
  assertTrue(em.containsBuildContrast());
  assertNull(em.getDesignFile());
  em.setDesignFile("String_Node_Str");
  assertEquals("String_Node_Str",em.getDesignFile());
  assertTrue(em.containsDesignFile());
  assertNull(em.getComparisons());
  em.setComparisons("String_Node_Str");
  assertEquals("String_Node_Str",em.getComparisons());
  assertTrue(em.containsComparisons());
  assertNull(em.getContrastFile());
  em.setContrastFile("String_Node_Str");
  assertEquals("String_Node_Str",em.getContrastFile());
  assertTrue(em.containsContrastFile());
}
Program: 141046
Project: 141046
Buggy source:
/** 
 * Wait the end of the main process.
 * @throws InterruptedException if an error occurs while waiting the end ofthe process
 * @throws IOException if an error occurs while waiting the end of the process
 */
public void waitFor() throws IOException {
  for (  Result result : this.processResults) {
    final int exitValue=result.waitFor();
    getLogger().fine("String_Node_Str" + exitValue + "String_Node_Str");
    if (exitValue != 0) {
      throw new IOException("String_Node_Str" + this.mapperName + "String_Node_Str"+ exitValue);
    }
  }
  for (  File f : this.filesToRemove) {
    removeFile(f);
  }
}

Fixed version (ground truth):
/** 
 * Wait the end of the main process.
 * @throws IOException if an error occurs while waiting the end of the process
 */
public void waitFor() throws IOException {
  for (  Result result : this.processResults) {
    final int exitValue=result.waitFor();
    getLogger().fine("String_Node_Str" + exitValue + "String_Node_Str");
    if (exitValue != 0) {
      throw new IOException("String_Node_Str" + this.mapperName + "String_Node_Str"+ exitValue);
    }
  }
  for (  File f : this.filesToRemove) {
    removeFile(f);
  }
}
Program: 141048
Project: 141048
Buggy source:
/** 
 * Public constructor
 * @param filename File to read
 * @throws IOException if the stream is null
 * @throws FileNotFoundException if the file doesn't exist
 */
public Eoulsan1DesignReader(final String filename) throws FileNotFoundException {
  checkNotNull(filename,"String_Node_Str");
  this.is=new FileInputStream(filename);
}

Fixed version (ground truth):
/** 
 * Public constructor
 * @param filename File to read
 * @throws FileNotFoundException if the file doesn't exist
 */
public Eoulsan1DesignReader(final String filename) throws FileNotFoundException {
  checkNotNull(filename,"String_Node_Str");
  this.is=new FileInputStream(filename);
}
Program: 141049
Project: 141049
Buggy source:
/** 
 * Read sample metadata experiment referring to a specific experiment.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sampleId the sample id
 * @throws IOException
 */
private void readExperimentSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  final List<String> expField=splitToList(this.dotSplitter,columnName);
  if (expField.size() != 3) {
    throw new IOException("String_Node_Str");
  }
  String expId=expField.get(1);
  String expKey=expField.get(2);
  if (!design.containsExperiment(expId)) {
    throw new IOException("String_Node_Str" + expId + "String_Node_Str");
  }
  final Experiment experiment=design.getExperiment(expId);
  if (!experiment.containsSample(sample)) {
    experiment.addSample(sample);
  }
  final ExperimentSample experimentSample=experiment.getExperimentSample(sample);
  final ExperimentSampleMetadata experimentSampleMetadata=experimentSample.getMetadata();
  if (experimentSampleMetadata.contains(expKey)) {
    throw new IOException("String_Node_Str" + expKey + "String_Node_Str");
  }
  experimentSampleMetadata.set(expKey,columnValue);
}

Fixed version (ground truth):
/** 
 * Read sample metadata experiment referring to a specific experiment.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sample the sample
 * @throws IOException
 */
private void readExperimentSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  final List<String> expField=splitToList(this.dotSplitter,columnName);
  if (expField.size() != 3) {
    throw new IOException("String_Node_Str");
  }
  String expId=expField.get(1);
  String expKey=expField.get(2);
  if (!design.containsExperiment(expId)) {
    throw new IOException("String_Node_Str" + expId + "String_Node_Str");
  }
  final Experiment experiment=design.getExperiment(expId);
  if (!experiment.containsSample(sample)) {
    experiment.addSample(sample);
  }
  final ExperimentSample experimentSample=experiment.getExperimentSample(sample);
  final ExperimentSampleMetadata experimentSampleMetadata=experimentSample.getMetadata();
  if (experimentSampleMetadata.contains(expKey)) {
    throw new IOException("String_Node_Str" + expKey + "String_Node_Str");
  }
  experimentSampleMetadata.set(expKey,columnValue);
}
Program: 141050
Project: 141050
Buggy source:
/** 
 * Read sample metadata.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sampleId the sample id
 * @throws IOException
 */
private void readSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  if (sample.getMetadata().contains(columnName)) {
    throw new IOException("String_Node_Str" + columnName + "String_Node_Str");
  }
  sample.getMetadata().set(columnName,columnValue);
}

Fixed version (ground truth):
/** 
 * Read sample metadata.
 * @param columnName the column name
 * @param columnValue the value
 * @param design the design object
 * @param sample the sample
 * @throws IOException
 */
private void readSampleMetadata(String columnName,String columnValue,Design design,Sample sample) throws IOException {
  if (sample.getMetadata().contains(columnName)) {
    throw new IOException("String_Node_Str" + columnName + "String_Node_Str");
  }
  sample.getMetadata().set(columnName,columnValue);
}
Program: 141051
Project: 141051
Buggy source:
/** 
 * Determine if there is biological replicates in an experiment
 * @param conditionsMap
 * @param rCondNames
 * @param rRepTechGroup
 * @return a boolean
 */
private boolean isBiologicalReplicates(final Map<String,List<Integer>> conditionsMap,final List<String> rCondNames,final List<String> rRepTechGroup){
  for (  String condition : rCondNames) {
    List<Integer> condPos=conditionsMap.get(condition);
    for (int i=0; i < condPos.size() - 1; i++) {
      int pos1=condPos.get(i);
      int pos2=condPos.get(i + 1);
      if (!rRepTechGroup.get(pos1).equals(rRepTechGroup.get(pos2))) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determine if there is biological replicates in an experiment
 * @param conditionsMap map of the conditions
 * @param rCondNames r condition names
 * @param rRepTechGroup replicate tech group
 * @return a boolean
 */
private boolean isBiologicalReplicates(final Map<String,List<Integer>> conditionsMap,final List<String> rCondNames,final List<String> rRepTechGroup){
  for (  String condition : rCondNames) {
    List<Integer> condPos=conditionsMap.get(condition);
    for (int i=0; i < condPos.size() - 1; i++) {
      int pos1=condPos.get(i);
      int pos2=condPos.get(i + 1);
      if (!rRepTechGroup.get(pos1).equals(rRepTechGroup.get(pos2))) {
        return true;
      }
    }
  }
  return false;
}
Program: 141052
Project: 141052
Buggy source:
/** 
 * Check deprecated parameters.
 * @param parameter the parameter to check
 * @param stepId step id
 * @throws EoulsanException if the parameter is no more supported
 */
static void checkDeprecatedParameter(final StepConfigurationContext context,final Parameter parameter) throws EoulsanException {
  if (parameter == null) {
    return;
  }
switch (parameter.getName()) {
case "String_Node_Str":
    Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
  Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
Modules.renamedParameter(context,parameter,"String_Node_Str");
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * Check deprecated parameters.
 * @param context step configuration context
 * @param parameter the parameter to check
 * @throws EoulsanException if the parameter is no more supported
 */
static void checkDeprecatedParameter(final StepConfigurationContext context,final Parameter parameter) throws EoulsanException {
  if (parameter == null) {
    return;
  }
switch (parameter.getName()) {
case "String_Node_Str":
    Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
  Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
Modules.renamedParameter(context,parameter,"String_Node_Str",true);
case "String_Node_Str":
Modules.renamedParameter(context,parameter,"String_Node_Str");
break;
default :
break;
}
}
Program: 141053
Project: 141053
Buggy source:
/** 
 * Compute the checksum of a ZIP file.
 * @param is input stream
 * @return the checksum as a string
 * @throws IOException if an error occurs while creating the checksum
 */
private static String computeZipCheckSum(final InputStream in) throws IOException {
  ZipArchiveInputStream zais=new ZipArchiveInputStream(in);
  final Hasher hs=Hashing.md5().newHasher();
  final Map<String,long[]> map=new HashMap<>();
  ZipArchiveEntry e;
  while ((e=zais.getNextZipEntry()) != null) {
    map.put(e.getName(),new long[]{e.getSize(),e.getCrc()});
  }
  zais.close();
  for (  String filename : new TreeSet<>(map.keySet())) {
    hs.putString(filename,StandardCharsets.UTF_8);
    for (    long l : map.get(filename)) {
      hs.putLong(l);
    }
  }
  return hs.hash().toString();
}

Fixed version (ground truth):
/** 
 * Compute the checksum of a ZIP file.
 * @param in input stream
 * @return the checksum as a string
 * @throws IOException if an error occurs while creating the checksum
 */
private static String computeZipCheckSum(final InputStream in) throws IOException {
  ZipArchiveInputStream zais=new ZipArchiveInputStream(in);
  final Hasher hs=Hashing.md5().newHasher();
  final Map<String,long[]> map=new HashMap<>();
  ZipArchiveEntry e;
  while ((e=zais.getNextZipEntry()) != null) {
    map.put(e.getName(),new long[]{e.getSize(),e.getCrc()});
  }
  zais.close();
  for (  String filename : new TreeSet<>(map.keySet())) {
    hs.putString(filename,StandardCharsets.UTF_8);
    for (    long l : map.get(filename)) {
      hs.putLong(l);
    }
  }
  return hs.hash().toString();
}
Program: 141055
Project: 141055
Buggy source:
/** 
 * Map method. Copies one file from source file system to destination.
 * @param key src len
 * @param value FilePair (FileStatus src, Path dst)
 * @param out Log of failed copies
 * @param reporter
 */
@Override public void map(final LongWritable key,final FilePair value,final OutputCollector<WritableComparable<?>,Text> out,final Reporter reporter) throws IOException {
  final FileStatus srcstat=value.input;
  final Path relativedst=new Path(value.output);
  try {
    copy(srcstat,relativedst,out,reporter);
  }
 catch (  IOException e) {
    ++this.failcount;
    reporter.incrCounter(Counter.FAIL,1);
    updateStatus(reporter);
    final String sfailure="String_Node_Str" + relativedst + "String_Node_Str"+ StringUtils.stringifyException(e);
    out.collect(null,new Text(sfailure));
    getLogger().info(sfailure);
    try {
      for (int i=0; i < 3; ++i) {
        try {
          final Path tmp=new Path(this.job.get(TMP_DIR_LABEL),relativedst);
          if (this.destFileSys.delete(tmp,true)) {
            break;
          }
        }
 catch (        Throwable ex) {
          getLogger().fine("String_Node_Str" + ex.getMessage());
        }
        updateStatus(reporter);
        Thread.sleep(3 * 1000);
      }
    }
 catch (    InterruptedException inte) {
      throw (IOException)new IOException().initCause(inte);
    }
  }
 finally {
    updateStatus(reporter);
  }
}

Fixed version (ground truth):
/** 
 * Map method. Copies one file from source file system to destination.
 * @param key src len
 * @param value FilePair (FileStatus src, Path dst)
 * @param out Log of failed copies
 * @param reporter Hadoop reporter
 */
@Override public void map(final LongWritable key,final FilePair value,final OutputCollector<WritableComparable<?>,Text> out,final Reporter reporter) throws IOException {
  final FileStatus srcstat=value.input;
  final Path relativedst=new Path(value.output);
  try {
    copy(srcstat,relativedst,out,reporter);
  }
 catch (  IOException e) {
    ++this.failcount;
    reporter.incrCounter(Counter.FAIL,1);
    updateStatus(reporter);
    final String sfailure="String_Node_Str" + relativedst + "String_Node_Str"+ StringUtils.stringifyException(e);
    out.collect(null,new Text(sfailure));
    getLogger().info(sfailure);
    try {
      for (int i=0; i < 3; ++i) {
        try {
          final Path tmp=new Path(this.job.get(TMP_DIR_LABEL),relativedst);
          if (this.destFileSys.delete(tmp,true)) {
            break;
          }
        }
 catch (        Throwable ex) {
          getLogger().fine("String_Node_Str" + ex.getMessage());
        }
        updateStatus(reporter);
        Thread.sleep(3 * 1000);
      }
    }
 catch (    InterruptedException inte) {
      throw (IOException)new IOException().initCause(inte);
    }
  }
 finally {
    updateStatus(reporter);
  }
}
Program: 141056
Project: 141056
Buggy source:
/** 
 * Calculate how many maps to run. Number of maps is bounded by a minimum of the cumulative size of the copy / (distcp.bytes.per.map, default BYTES_PER_MAP or -m on the command line) and at most (distcp.max.map.tasks, default MAX_MAPS_PER_NODE * nodes in the cluster).
 * @param totalBytes Count of total bytes for job
 * @param job The job to configure
 * @return Count of maps to run.
 */
private static void setMapCount(final long totalBytes,final JobConf job) throws IOException {
  int numMaps=(int)(totalBytes / job.getLong(BYTES_PER_MAP_LABEL,BYTES_PER_MAP));
  numMaps=Math.min(numMaps,job.getInt(MAX_MAPS_LABEL,MAX_MAPS_PER_NODE * new JobClient(job).getClusterStatus().getTaskTrackers()));
  job.setNumMapTasks(Math.max(numMaps,1));
}

Fixed version (ground truth):
/** 
 * Calculate how many maps to run. Number of maps is bounded by a minimum of the cumulative size of the copy / (distcp.bytes.per.map, default BYTES_PER_MAP or -m on the command line) and at most (distcp.max.map.tasks, default MAX_MAPS_PER_NODE * nodes in the cluster).
 * @param totalBytes Count of total bytes for job
 * @param job The job to configure
 */
private static void setMapCount(final long totalBytes,final JobConf job) throws IOException {
  int numMaps=(int)(totalBytes / job.getLong(BYTES_PER_MAP_LABEL,BYTES_PER_MAP));
  numMaps=Math.min(numMaps,job.getInt(MAX_MAPS_LABEL,MAX_MAPS_PER_NODE * new JobClient(job).getClusterStatus().getTaskTrackers()));
  job.setNumMapTasks(Math.max(numMaps,1));
}
Program: 141057
Project: 141057
Buggy source:
/** 
 * Create a new executable requirement.
 * @param executableName the executable name
 * @param optional true if the executable is a mandatory requirement
 * @return a new PathRequirement object
 * @throws EoulsanException if an error occurs while configuring therequirement
 */
public static Requirement newPathRequirement(final String executableName,final boolean optional){
  checkNotNull(executableName,"String_Node_Str");
  checkArgument(!executableName.trim().isEmpty(),"String_Node_Str");
  final PathRequirement result=new PathRequirement();
  result.executableName=executableName.trim();
  result.setInstallable(false);
  result.setOptionnal(optional);
  return result;
}

Fixed version (ground truth):
/** 
 * Create a new executable requirement.
 * @param executableName the executable name
 * @param optional true if the executable is a mandatory requirement
 * @return a new PathRequirement object
 */
public static Requirement newPathRequirement(final String executableName,final boolean optional){
  checkNotNull(executableName,"String_Node_Str");
  checkArgument(!executableName.trim().isEmpty(),"String_Node_Str");
  final PathRequirement result=new PathRequirement();
  result.executableName=executableName.trim();
  result.setInstallable(false);
  result.setOptionnal(optional);
  return result;
}
Program: 141058
Project: 141058
Buggy source:
/** 
 * Create a new Rserve requirement.
 * @param rserveServerName the Rserve server name
 * @param optional true if the Rserve server is a mandatory requirement
 * @throws EoulsanException if an error occurs while configuring therequirement
 */
public static Requirement newRserveRequirement(final String rserveServerName,final boolean optional){
  checkNotNull(rserveServerName,"String_Node_Str");
  checkArgument(!rserveServerName.trim().isEmpty(),"String_Node_Str");
  final RserveRequirement result=new RserveRequirement();
  result.serverName=rserveServerName.trim();
  result.setInstallable(false);
  result.setOptionnal(optional);
  return result;
}

Fixed version (ground truth):
/** 
 * Create a new Rserve requirement.
 * @param rserveServerName the Rserve server name
 * @param optional true if the Rserve server is a mandatory requirement
 */
public static Requirement newRserveRequirement(final String rserveServerName,final boolean optional){
  checkNotNull(rserveServerName,"String_Node_Str");
  checkArgument(!rserveServerName.trim().isEmpty(),"String_Node_Str");
  final RserveRequirement result=new RserveRequirement();
  result.serverName=rserveServerName.trim();
  result.setInstallable(false);
  result.setOptionnal(optional);
  return result;
}
Program: 141059
Project: 141059
Buggy source:
/** 
 * Launch test.
 * @throws FileNotFoundException the XML file is not found
 * @throws Exception if an error occurs during setting or execution on atest
 */
public void launchTest() throws FileNotFoundException, EoulsanException {
  if (this.command == null || this.command.isEmpty()) {
    throw new EoulsanException("String_Node_Str");
  }
  final InputStream is=this.getClass().getResourceAsStream(toolXMLPath);
  assertNotNull("String_Node_Str" + toolXMLPath,is);
  final GalaxyToolInterpreter interpreter=new GalaxyToolInterpreter(is);
  interpreter.configure(setStepParameters);
  compileParameters(interpreter);
  final ToolData toolData=interpreter.getToolData();
  final CheetahInterpreter tpi=new CheetahInterpreter(toolData.getCommandScript(),this.variablesCommand);
  compareCommandLine(tpi.execute());
}

Fixed version (ground truth):
/** 
 * Launch test.
 * @throws FileNotFoundException the XML file is not found
 * @throws EoulsanException if an error occurs during setting or execution on atest
 */
public void launchTest() throws FileNotFoundException, EoulsanException {
  if (this.command == null || this.command.isEmpty()) {
    throw new EoulsanException("String_Node_Str");
  }
  final InputStream is=this.getClass().getResourceAsStream(toolXMLPath);
  assertNotNull("String_Node_Str" + toolXMLPath,is);
  final GalaxyToolInterpreter interpreter=new GalaxyToolInterpreter(is);
  interpreter.configure(setStepParameters);
  compileParameters(interpreter);
  final ToolData toolData=interpreter.getToolData();
  final CheetahInterpreter tpi=new CheetahInterpreter(toolData.getCommandScript(),this.variablesCommand);
  compareCommandLine(tpi.execute());
}
Program: 141060
Project: 141060
Buggy source:
/** 
 * Check deprecated setting key.
 * @param key the key to check
 * @return the new name of the key if exists or the current key name
 */
private static String checkDeprecatedKey(final String key){
  if (key == null) {
    return null;
  }
  final String trimmedKey=key.trim().toLowerCase();
switch (trimmedKey) {
case "String_Node_Str":
    printWarningRenamedSetting(trimmedKey,AWS_ACCESS_KEY);
case "String_Node_Str":
  printWarningRenamedSetting(trimmedKey,AWS_SECRET_KEY);
case "String_Node_Str":
printWarningRenamedSetting(trimmedKey,GFF_STORAGE_KEY);
return GFF_STORAGE_KEY;
default :
return key;
}
}

Fixed version (ground truth):
/** 
 * Check deprecated setting key.
 * @param key the key to check
 * @return the new name of the key if exists or the current key name
 */
private static String checkDeprecatedKey(final String key){
  if (key == null) {
    return null;
  }
  final String trimmedKey=key.trim().toLowerCase();
switch (trimmedKey) {
case "String_Node_Str":
    printWarningRenamedSetting(trimmedKey,AWS_ACCESS_KEY);
  break;
case "String_Node_Str":
printWarningRenamedSetting(trimmedKey,AWS_SECRET_KEY);
break;
case "String_Node_Str":
printWarningRenamedSetting(trimmedKey,GFF_STORAGE_KEY);
return GFF_STORAGE_KEY;
default :
return key;
}
return key;
}
Program: 141061
Project: 141061
Buggy source:
/** 
 * Set if Eoulsan result files must be written using the old format.
 * @param useOldEoulsanResultFormat true if Eoulsan result files must bewritten using the old format
 */
public void setUseOldEoulsanResultFormat(final boolean useOldEoulsanResultFormat){
  this.properties.getProperty(USE_OLD_EOULSAN_RESULT_FORMAT_KEY,Boolean.toString(useOldEoulsanResultFormat));
}

Fixed version (ground truth):
/** 
 * Set if Eoulsan result files must be written using the old format.
 * @param useOldEoulsanResultFormat true if Eoulsan result files must bewritten using the old format
 */
public void setUseOldEoulsanResultFormat(final boolean useOldEoulsanResultFormat){
  this.properties.setProperty(USE_OLD_EOULSAN_RESULT_FORMAT_KEY,Boolean.toString(useOldEoulsanResultFormat));
}
Program: 141062
Project: 141062
Buggy source:
@Override public int compareTo(final GenomicInterval e){
  if (e == null) {
    return -1;
  }
  if (!getChromosome().equals(e.getChromosome())) {
    return getChromosome().compareTo(e.getChromosome());
  }
  final int startComp=((Integer)this.start).compareTo(e.getStart());
  if (startComp != 0) {
    return startComp;
  }
  return ((Integer)this.end).compareTo(e.getEnd());
}

Fixed version (ground truth):
@Override public int compareTo(final GenomicInterval e){
  if (e == null) {
    return -1;
  }
  if (!getChromosome().equals(e.getChromosome())) {
    return getChromosome().compareTo(e.getChromosome());
  }
  final int startComp=Integer.compare(this.start,e.getStart());
  if (startComp != 0) {
    return startComp;
  }
  return ((Integer)this.end).compareTo(e.getEnd());
}