nus-yam/ex-repair huggingface dataset:
Program: 141063
Project: 141063
Buggy source:
/** 
 * Compare 2 Version object.
 * @param version Version to compare.
 * @return a negative integer, zero, or a positive integer as this object isless than, equal to, or greater than the specified object.
 */
@Override public int compareTo(final Version version){
  if (version == null) {
    return 1;
  }
  final int compMajor=Integer.valueOf(getMajor()).compareTo(version.getMajor());
  if (compMajor != 0) {
    return compMajor;
  }
  final int compMinor=Integer.valueOf(getMinor()).compareTo(version.getMinor());
  if (compMinor != 0) {
    return compMinor;
  }
  final int compRevision=Integer.valueOf(getRevision()).compareTo(version.getRevision());
  if (compRevision != 0) {
    return compRevision;
  }
  return getType().compareTo(version.getType());
}

Fixed version (ground truth):
/** 
 * Compare 2 Version object.
 * @param version Version to compare.
 * @return a negative integer, zero, or a positive integer as this object isless than, equal to, or greater than the specified object.
 */
@Override public int compareTo(final Version version){
  if (version == null) {
    return 1;
  }
  final int compMajor=Integer.compare(getMajor(),version.getMajor());
  if (compMajor != 0) {
    return compMajor;
  }
  final int compMinor=Integer.valueOf(getMinor()).compareTo(version.getMinor());
  if (compMinor != 0) {
    return compMinor;
  }
  final int compRevision=Integer.valueOf(getRevision()).compareTo(version.getRevision());
  if (compRevision != 0) {
    return compRevision;
  }
  return getType().compareTo(version.getType());
}
Program: 141064
Project: 141064
Buggy source:
/** 
 * Get the singleton instance of the class.
 * @return the singleton instance of the class
 */
public static EmergencyStopTasks getInstance(){
  if (instance == null) {
    instance=new EmergencyStopTasks();
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Get the singleton instance of the class.
 * @return the singleton instance of the class
 */
public static synchronized EmergencyStopTasks getInstance(){
  if (instance == null) {
    instance=new EmergencyStopTasks();
  }
  return instance;
}
Program: 141065
Project: 141065
Buggy source:
public TaskResultImpl(final TaskContextImpl context,final Date startTime,final Date endTime,final long duration,final Throwable exception,final String errorMessage){
  Preconditions.checkNotNull(context,"String_Node_Str");
  this.context=context;
  this.startTime=startTime;
  this.endTime=endTime;
  this.duration=duration;
  this.success=false;
  this.taskMessage=null;
  this.taskDescription=null;
  this.exception=exception;
  this.errorMessage=errorMessage;
}

Fixed version (ground truth):
public TaskResultImpl(final TaskContextImpl context,final Date startTime,final Date endTime,final long duration,final Throwable exception,final String errorMessage){
  Preconditions.checkNotNull(context,"String_Node_Str");
  this.context=context;
  this.startTime=startTime == null ? null : new Date(startTime.getTime());
  this.endTime=endTime == null ? null : new Date(endTime.getTime());
  this.duration=duration;
  this.success=false;
  this.taskMessage=null;
  this.taskDescription=null;
  this.exception=exception;
  this.errorMessage=errorMessage;
}
Program: 141066
Project: 141066
Buggy source:
@Override public List<DataFile> list(final DataFile file) throws IOException {
  final File directoryFile=getSourceAsFile(file);
  if (!directoryFile.exists()) {
    throw new FileNotFoundException("String_Node_Str" + file);
  }
  if (!directoryFile.isDirectory()) {
    throw new IOException("String_Node_Str" + file);
  }
  final File[] files=directoryFile.listFiles();
  final List<DataFile> result=new ArrayList<>(files.length);
  for (  File f : files) {
    result.add(new DataFile(f));
  }
  return Collections.unmodifiableList(result);
}

Fixed version (ground truth):
@Override public List<DataFile> list(final DataFile file) throws IOException {
  final File directoryFile=getSourceAsFile(file);
  if (!directoryFile.exists()) {
    throw new FileNotFoundException("String_Node_Str" + file);
  }
  if (!directoryFile.isDirectory()) {
    throw new IOException("String_Node_Str" + file);
  }
  final File[] files=directoryFile.listFiles();
  if (files == null) {
    return Collections.emptyList();
  }
  final List<DataFile> result=new ArrayList<>(files.length);
  for (  File f : files) {
    result.add(new DataFile(f));
  }
  return Collections.unmodifiableList(result);
}
Program: 141067
Project: 141067
Buggy source:
/** 
 * Tab.
 * @param n the n
 * @return the string
 */
protected String tab(final int n){
  String str="String_Node_Str";
  for (int i=0; i < tabulations + n; i++) {
    str+=TAB;
  }
  tabulations+=n;
  return str;
}

Fixed version (ground truth):
/** 
 * Tab.
 * @param n the n
 * @return the string
 */
protected String tab(final int n){
  final StringBuilder sb=new StringBuilder();
  for (int i=0; i < tabulations + n; i++) {
    sb.append(TAB);
  }
  tabulations+=n;
  return sb.toString();
}
Program: 141068
Project: 141068
Buggy source:
@Override public int compare(final Data a,final Data b){
  return Integer.valueOf(a.getPart()).compareTo(b.getPart());
}

Fixed version (ground truth):
@Override public int compare(final Data a,final Data b){
  return Integer.compare(a.getPart(),b.getPart());
}
Program: 141069
Project: 141069
Buggy source:
public Iterator<DataFile> getIterator(final String dataName,final int fileIndex) throws EoulsanException {
  final List<Data> list=Lists.newArrayList(this.map.get(dataName));
  Collections.sort(list,new Comparator<Data>(){
    @Override public int compare(    final Data a,    final Data b){
      return Integer.valueOf(a.getPart()).compareTo(b.getPart());
    }
  }
);
  if (checkForPartDuplicates()) {
    final Set<Integer> partNumbers=new HashSet<>();
    for (    Data data : list) {
      if (partNumbers.contains(data.getPart())) {
        throw new EoulsanException("String_Node_Str" + data.getName());
      }
      partNumbers.add(data.getPart());
    }
  }
  final Iterator<Data> it=list.iterator();
  return new Iterator<DataFile>(){
    @Override public boolean hasNext(){
      return it.hasNext();
    }
    @Override public DataFile next(){
      if (fileIndex == -1) {
        return it.next().getDataFile();
      }
 else {
        return it.next().getDataFile(fileIndex);
      }
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}

Fixed version (ground truth):
public Iterator<DataFile> getIterator(final String dataName,final int fileIndex) throws EoulsanException {
  final List<Data> list=Lists.newArrayList(this.map.get(dataName));
  Collections.sort(list,new Comparator<Data>(){
    @Override public int compare(    final Data a,    final Data b){
      return Integer.compare(a.getPart(),b.getPart());
    }
  }
);
  if (checkForPartDuplicates()) {
    final Set<Integer> partNumbers=new HashSet<>();
    for (    Data data : list) {
      if (partNumbers.contains(data.getPart())) {
        throw new EoulsanException("String_Node_Str" + data.getName());
      }
      partNumbers.add(data.getPart());
    }
  }
  final Iterator<Data> it=list.iterator();
  return new Iterator<DataFile>(){
    @Override public boolean hasNext(){
      return it.hasNext();
    }
    @Override public DataFile next(){
      if (fileIndex == -1) {
        return it.next().getDataFile();
      }
 else {
        return it.next().getDataFile(fileIndex);
      }
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}
Program: 141070
Project: 141070
Buggy source:
@Override public int compare(final DataFile f1,final DataFile f2){
  long size1;
  try {
    size1=f1.getMetaData().getContentLength();
  }
 catch (  IOException e) {
    size1=-1;
  }
  long size2;
  try {
    size2=f2.getMetaData().getContentLength();
  }
 catch (  IOException e) {
    size2=-1;
  }
  return ((Long)size1).compareTo(size2) * -1;
}

Fixed version (ground truth):
@Override public int compare(final DataFile f1,final DataFile f2){
  long size1;
  try {
    size1=f1.getMetaData().getContentLength();
  }
 catch (  IOException e) {
    size1=-1;
  }
  long size2;
  try {
    size2=f2.getMetaData().getContentLength();
  }
 catch (  IOException e) {
    size2=-1;
  }
  return Long.compare(size1,size2) * -1;
}
Program: 141071
Project: 141071
Buggy source:
/** 
 * Sort a list of DataFile by dissident order.
 * @param inFiles list of DataFile to sort
 */
private void sortInFilesByDescSize(final List<DataFile> inFiles){
  Collections.sort(inFiles,new Comparator<DataFile>(){
    @Override public int compare(    final DataFile f1,    final DataFile f2){
      long size1;
      try {
        size1=f1.getMetaData().getContentLength();
      }
 catch (      IOException e) {
        size1=-1;
      }
      long size2;
      try {
        size2=f2.getMetaData().getContentLength();
      }
 catch (      IOException e) {
        size2=-1;
      }
      return ((Long)size1).compareTo(size2) * -1;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Sort a list of DataFile by dissident order.
 * @param inFiles list of DataFile to sort
 */
private void sortInFilesByDescSize(final List<DataFile> inFiles){
  Collections.sort(inFiles,new Comparator<DataFile>(){
    @Override public int compare(    final DataFile f1,    final DataFile f2){
      long size1;
      try {
        size1=f1.getMetaData().getContentLength();
      }
 catch (      IOException e) {
        size1=-1;
      }
      long size2;
      try {
        size2=f2.getMetaData().getContentLength();
      }
 catch (      IOException e) {
        size2=-1;
      }
      return Long.compare(size1,size2) * -1;
    }
  }
);
}
Program: 141072
Project: 141072
Buggy source:
@Override public void notifyWorkflowSuccess(final boolean success,final String message){
  if (this.terminal == null || this.jobDone) {
    return;
  }
synchronized (this) {
    this.terminal.setCursorVisible(false);
    final int lastLineY=this.terminalSize.getRows() - 1;
    showWorkflowProgress(lastLineY,1.0,success,message);
    this.terminal.moveCursor(0,lastLineY);
    this.terminal.setCursorVisible(true);
    this.jobDone=true;
  }
}

Fixed version (ground truth):
@Override public void notifyWorkflowSuccess(final boolean success,final String message){
synchronized (this) {
    if (this.terminal == null || this.jobDone) {
      return;
    }
    this.terminal.setCursorVisible(false);
    final int lastLineY=this.terminalSize.getRows() - 1;
    showWorkflowProgress(lastLineY,1.0,success,message);
    this.terminal.moveCursor(0,lastLineY);
    this.terminal.setCursorVisible(true);
    this.jobDone=true;
  }
}
Program: 141073
Project: 141073
Buggy source:
@Override public int compareTo(final Ticket ticket){
  if (ticket == null) {
    return 1;
  }
  final int comp1=Long.valueOf(this.creationTime).compareTo(ticket.creationTime);
  if (comp1 != 0) {
    return comp1;
  }
  final int comp2=Long.valueOf(this.nanoCreationTime).compareTo(ticket.nanoCreationTime);
  if (comp2 != 0) {
    return comp2;
  }
  final int comp3=Integer.valueOf(this.pid).compareTo(ticket.pid);
  if (comp3 != 0) {
    return comp3;
  }
  return Long.valueOf(this.threadId).compareTo(ticket.threadId);
}

Fixed version (ground truth):
@Override public int compareTo(final Ticket ticket){
  if (ticket == null) {
    return 1;
  }
  final int comp1=Long.compare(this.creationTime,ticket.creationTime);
  if (comp1 != 0) {
    return comp1;
  }
  final int comp2=Long.valueOf(this.nanoCreationTime).compareTo(ticket.nanoCreationTime);
  if (comp2 != 0) {
    return comp2;
  }
  final int comp3=Integer.compare(this.pid,ticket.pid);
  if (comp3 != 0) {
    return comp3;
  }
  return Long.valueOf(this.threadId).compareTo(ticket.threadId);
}
Program: 141075
Project: 141075
Buggy source:
/** 
 * Add a list of temporary files to remove at the end of the mapping.
 * @param files files to remove
 */
protected void addFilesToRemove(final File... files){
  if (files == null) {
    return;
  }
  for (  File f : files) {
    this.filesToRemove.add(f);
  }
}

Fixed version (ground truth):
/** 
 * Add a list of temporary files to remove at the end of the mapping.
 * @param files files to remove
 */
protected void addFilesToRemove(final File... files){
  if (files == null) {
    return;
  }
  Collections.addAll(this.filesToRemove,files);
}
Program: 141080
Project: 141080
Buggy source:
@Override String buildLineScript(final String line){
  final StringBuilder txt=new StringBuilder();
  txt.append(this.tab(currentTabCount));
  txt.append(VAR_CMD_NAME);
  txt.append("String_Node_Str");
  txt.append(line);
  txt.append("String_Node_Str");
  return txt.toString();
}

Fixed version (ground truth):
@Override String buildLineScript(final String line){
  return this.tab(currentTabCount) + VAR_CMD_NAME + "String_Node_Str"+ line+ "String_Node_Str";
}
Program: 141081
Project: 141081
Buggy source:
/** 
 * Gets the report on execution command line.
 * @return the report
 */
public String getReport(){
  if (isReportCreated) {
    return this.message.toString();
  }
  this.message.append("String_Node_Str" + this.desc + "String_Node_Str");
  this.message.append("String_Node_Str" + this.commandLine);
  this.message.append("String_Node_Str" + this.directory.getAbsolutePath());
  this.message.append("String_Node_Str" + (this.duration == -1 ? "String_Node_Str" : toTimeHumanReadable(this.duration)));
  this.message.append("String_Node_Str" + this.exitValue);
  this.message.append(getSTDERRMessageOnProcess());
  if (isInterruptedProcess()) {
    this.message.append("String_Node_Str" + toTimeHumanReadable(durationMaxToInterruptProcess));
  }
  this.message.append("String_Node_Str");
  isReportCreated=true;
  return this.message.toString();
}

Fixed version (ground truth):
/** 
 * Gets the report on execution command line.
 * @return the report
 */
public String getReport(){
  if (isReportCreated) {
    return this.message.toString();
  }
  this.message.append("String_Node_Str");
  this.message.append(this.desc);
  this.message.append("String_Node_Str");
  this.message.append("String_Node_Str");
  this.message.append(this.commandLine);
  this.message.append("String_Node_Str");
  this.message.append(this.directory.getAbsolutePath());
  this.message.append("String_Node_Str");
  this.message.append(this.duration == -1 ? "String_Node_Str" : toTimeHumanReadable(this.duration));
  this.message.append("String_Node_Str");
  this.message.append(this.exitValue);
  this.message.append(getSTDERRMessageOnProcess());
  if (isInterruptedProcess()) {
    this.message.append("String_Node_Str");
    this.message.append(toTimeHumanReadable(durationMaxToInterruptProcess));
  }
  this.message.append("String_Node_Str");
  isReportCreated=true;
  return this.message.toString();
}
Program: 141082
Project: 141082
Buggy source:
/** 
 * Adds the stderr message on process in the report.
 * @return the string
 */
public String getSTDERRMessageOnProcess(){
  if (stderrFile == null || !stderrFile.exists()) {
    return "String_Node_Str";
  }
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + this.stderrFile.getAbsolutePath() + "String_Node_Str");
  try (BufferedReader br=Files.newReader(stderrFile,DEFAULT_CHARSET)){
    String line="String_Node_Str";
    while ((line=br.readLine()) != null) {
      sb.append("String_Node_Str" + line);
    }
    sb.append("String_Node_Str");
  }
 catch (  IOException e) {
    sb.append("String_Node_Str" + stderrFile.getAbsolutePath() + "String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Adds the stderr message on process in the report.
 * @return the string
 */
public String getSTDERRMessageOnProcess(){
  if (stderrFile == null || !stderrFile.exists()) {
    return "String_Node_Str";
  }
  final StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(this.stderrFile.getAbsolutePath());
  sb.append('\n');
  try (BufferedReader br=Files.newReader(stderrFile,DEFAULT_CHARSET)){
    String line="String_Node_Str";
    while ((line=br.readLine()) != null) {
      sb.append("String_Node_Str");
      sb.append(line);
    }
    sb.append("String_Node_Str");
  }
 catch (  IOException e) {
    sb.append("String_Node_Str");
    sb.append(stderrFile.getAbsolutePath());
    sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 141083
Project: 141083
Buggy source:
/** 
 * Delete file matching on pattern, if is a link, delete the real file too.
 * @param itResult the it result
 * @param isDeleteFileRequired the is delete file required.
 */
public void deleteFileMatchingOnPattern(final ITResult itResult,final boolean isDeleteFileRequired){
  final List<File> linksSymbolic=new ArrayList<>();
  StringBuilder msg=new StringBuilder();
  msg.append("String_Node_Str");
  boolean success=true;
  if (!itResult.isSuccess()) {
    msg.append((isDeleteFileRequired ? "String_Node_Str" : "String_Node_Str") + this.directory.getAbsolutePath());
  }
  if (itResult.isSuccess() && isDeleteFileRequired) {
    msg.append("String_Node_Str");
    msg.append("String_Node_Str" + this.directory.getAbsolutePath());
    for (    File f : getFilesToRemove()) {
      if (Files.isSymbolicLink(f.toPath())) {
        linksSymbolic.add(f);
        continue;
      }
      if (!f.delete()) {
        success=false;
        msg.append("String_Node_Str" + f.getAbsolutePath());
      }
    }
    final String s=removeBrokenSymbolicLink(linksSymbolic);
    msg.append(s);
    if (success) {
      msg.append("String_Node_Str");
    }
  }
 else {
    msg.append("String_Node_Str");
  }
  itResult.addCommentsIntoTextReport(msg.toString());
}

Fixed version (ground truth):
/** 
 * Delete file matching on pattern, if is a link, delete the real file too.
 * @param itResult the it result
 * @param isDeleteFileRequired the is delete file required.
 */
public void deleteFileMatchingOnPattern(final ITResult itResult,final boolean isDeleteFileRequired){
  final List<File> linksSymbolic=new ArrayList<>();
  StringBuilder msg=new StringBuilder();
  msg.append("String_Node_Str");
  boolean success=true;
  if (!itResult.isSuccess()) {
    msg.append(isDeleteFileRequired ? "String_Node_Str" : "String_Node_Str");
    msg.append(this.directory.getAbsolutePath());
  }
  if (itResult.isSuccess() && isDeleteFileRequired) {
    msg.append("String_Node_Str");
    msg.append("String_Node_Str");
    msg.append(this.directory.getAbsolutePath());
    for (    File f : getFilesToRemove()) {
      if (Files.isSymbolicLink(f.toPath())) {
        linksSymbolic.add(f);
        continue;
      }
      if (!f.delete()) {
        success=false;
        msg.append("String_Node_Str");
        msg.append(f.getAbsolutePath());
      }
    }
    final String s=removeBrokenSymbolicLink(linksSymbolic);
    msg.append(s);
    if (success) {
      msg.append("String_Node_Str");
    }
  }
 else {
    msg.append("String_Node_Str");
  }
  itResult.addCommentsIntoTextReport(msg.toString());
}
Program: 141084
Project: 141084
Buggy source:
/** 
 * Removes broken symbolic links.
 * @param linksSymbolic the links symbolic
 * @return message to final report
 */
private String removeBrokenSymbolicLink(final List<File> linksSymbolic){
  final StringBuilder msg=new StringBuilder();
  for (  File link : linksSymbolic) {
    File realFile=null;
    try {
      realFile=Files.readSymbolicLink(link.toPath()).toFile();
    }
 catch (    IOException e) {
    }
    if (realFile == null)     continue;
    if (!realFile.exists()) {
      if (link.delete()) {
        msg.append("String_Node_Str" + link.getName());
      }
    }
  }
  return msg.toString();
}

Fixed version (ground truth):
/** 
 * Removes broken symbolic links.
 * @param linksSymbolic the links symbolic
 * @return message to final report
 */
private String removeBrokenSymbolicLink(final List<File> linksSymbolic){
  final StringBuilder msg=new StringBuilder();
  for (  File link : linksSymbolic) {
    File realFile=null;
    try {
      realFile=Files.readSymbolicLink(link.toPath()).toFile();
    }
 catch (    IOException e) {
    }
    if (realFile == null)     continue;
    if (!realFile.exists()) {
      if (link.delete()) {
        msg.append("String_Node_Str");
        msg.append(link.getName());
      }
    }
  }
  return msg.toString();
}
Program: 141085
Project: 141085
Buggy source:
/** 
 * Get report on comparison.
 * @return report on comparison
 */
public String getReport(){
  final StringBuilder txt=new StringBuilder();
  txt.append("String_Node_Str" + this.statusComparison.getType() + "String_Node_Str"+ this.filename);
  if (this.statusComparison.getType().equals(TYPE_FAIL)) {
    txt.append("String_Node_Str" + this.statusComparison.getName());
    txt.append("String_Node_Str" + this.fileTestedPath);
    txt.append("String_Node_Str" + this.fileExpectedPath);
    txt.append("String_Node_Str" + this.message);
  }
  return txt.toString();
}

Fixed version (ground truth):
/** 
 * Get report on comparison.
 * @return report on comparison
 */
public String getReport(){
  final StringBuilder txt=new StringBuilder();
  txt.append("String_Node_Str").append(this.statusComparison.getType()).append("String_Node_Str");
  txt.append(this.filename);
  if (this.statusComparison.getType().equals(TYPE_FAIL)) {
    txt.append("String_Node_Str");
    txt.append(this.statusComparison.getName());
    txt.append("String_Node_Str");
    txt.append(this.fileTestedPath);
    txt.append("String_Node_Str");
    txt.append(this.fileExpectedPath);
    txt.append("String_Node_Str");
    txt.append(this.message);
  }
  return txt.toString();
}
Program: 141086
Project: 141086
Buggy source:
/** 
 * Set the entry.
 * @return
 */
public Set<Map.Entry<String,String>> entrySet(){
  return Collections.unmodifiableSet(this.metadata.entrySet());
}

Fixed version (ground truth):
/** 
 * Get an entry set of the metadata.
 * @return a set of entries
 */
public Set<Map.Entry<String,String>> entrySet(){
  return Collections.unmodifiableSet(this.metadata.entrySet());
}
Program: 141087
Project: 141087
Buggy source:
/** 
 * Set the key.
 * @return
 */
public Set<String> keySet(){
  return Collections.unmodifiableSet(this.metadata.keySet());
}

Fixed version (ground truth):
/** 
 * Get the keys of the metadata
 * @return a set with the keys of the metadata
 */
public Set<String> keySet(){
  return Collections.unmodifiableSet(this.metadata.keySet());
}
Program: 141088
Project: 141088
Buggy source:
/** 
 * Get all the experiment metadata keys of the samples of a design.
 * @param design the design
 * @return a list with the experiment metadata keys of the samples of a design
 */
public static List<String> getExperimentSampleAllMetadataKeys(final Experiment experiment){
  checkNotNull(experiment,"String_Node_Str");
  final List<String> result=new ArrayList<>();
  final Set<String> keys=new HashSet<>();
  for (  ExperimentSample sample : experiment.getExperimentSamples()) {
    for (    String key : sample.getMetadata().keySet()) {
      if (keys.contains(key)) {
        continue;
      }
      keys.add(key);
      result.add(key);
    }
  }
  return Collections.unmodifiableList(result);
}

Fixed version (ground truth):
/** 
 * Get all the experiment metadata keys of the samples of a design.
 * @param experiment the experiment
 * @return a list with the experiment metadata keys of the samples of a design
 */
public static List<String> getExperimentSampleAllMetadataKeys(final Experiment experiment){
  checkNotNull(experiment,"String_Node_Str");
  final List<String> result=new ArrayList<>();
  final Set<String> keys=new HashSet<>();
  for (  ExperimentSample sample : experiment.getExperimentSamples()) {
    for (    String key : sample.getMetadata().keySet()) {
      if (keys.contains(key)) {
        continue;
      }
      keys.add(key);
      result.add(key);
    }
  }
  return Collections.unmodifiableList(result);
}
Program: 141089
Project: 141089
Buggy source:
/** 
 * Set the name of the experiment.
 * @param newExperimentName the new experiment name
 * @return the experiment name
 */
public void setName(String newExperimentName){
  checkNotNull(newExperimentName,"String_Node_Str");
  final String name=newExperimentName.trim();
  checkArgument(!this.design.containsExperimentName(name),"String_Node_Str" + name);
  this.experimentName=name;
}

Fixed version (ground truth):
/** 
 * Set the name of the experiment.
 * @param newExperimentName the new experiment name
 */
public void setName(String newExperimentName){
  checkNotNull(newExperimentName,"String_Node_Str");
  final String name=newExperimentName.trim();
  checkArgument(!this.design.containsExperimentName(name),"String_Node_Str" + name);
  this.experimentName=name;
}
Program: 141090
Project: 141090
Buggy source:
/** 
 * Add a sample.
 * @param sampleId the sample id
 * @return the sample object
 */
public ExperimentSample addSample(final Sample sample){
  checkNotNull(sample,"String_Node_Str");
  checkArgument(!this.samples.contains(sample),"String_Node_Str" + sample.getId());
  checkArgument(sample.getDesign() == this.design,"String_Node_Str" + sample.getId());
  final ExperimentSample newExperimentSample=new ExperimentSample(sample);
  this.samples.add(newExperimentSample);
  return newExperimentSample;
}

Fixed version (ground truth):
/** 
 * Add a sample.
 * @param sample the sample to add
 * @return an experiment sample object
 */
public ExperimentSample addSample(final Sample sample){
  checkNotNull(sample,"String_Node_Str");
  checkArgument(!this.samples.contains(sample),"String_Node_Str" + sample.getId());
  checkArgument(sample.getDesign() == this.design,"String_Node_Str" + sample.getId());
  final ExperimentSample newExperimentSample=new ExperimentSample(sample);
  this.samples.add(newExperimentSample);
  return newExperimentSample;
}
Program: 141091
Project: 141091
Buggy source:
/** 
 * Remove the sample.
 * @param sampleId the sample id
 */
public void removeSample(final Sample sample){
  checkNotNull(sample,"String_Node_Str");
  checkArgument(this.samples.contains(sample),"String_Node_Str" + sample.getId());
  checkArgument(sample.getDesign() == this.design,"String_Node_Str" + sample.getId());
  this.samples.remove(sample);
}

Fixed version (ground truth):
/** 
 * Remove the sample.
 * @param sample the sample to remove
 */
public void removeSample(final Sample sample){
  checkNotNull(sample,"String_Node_Str");
  checkArgument(this.samples.contains(sample),"String_Node_Str" + sample.getId());
  checkArgument(sample.getDesign() == this.design,"String_Node_Str" + sample.getId());
  this.samples.remove(sample);
}
Program: 141092
Project: 141092
Buggy source:
/** 
 * Set the contrastFile DEseq2 option.
 * @param newcontrastFile the new contrastFile DEseq2 option
 */
public void setContrastFile(String newContrastFile){
  set(CONTRAST_FILE_KEY,newContrastFile);
}

Fixed version (ground truth):
/** 
 * Set the contrastFile DEseq2 option.
 * @param newContrastFile the new contrastFile DEseq2 option
 */
public void setContrastFile(String newContrastFile){
  set(CONTRAST_FILE_KEY,newContrastFile);
}
Program: 141093
Project: 141093
Buggy source:
/** 
 * Set the skip option.
 * @param newSkip the new skip option
 */
public void setSkip(boolean skip){
  set(SKIP_KEY,"String_Node_Str" + skip);
}

Fixed version (ground truth):
/** 
 * Set the skip option.
 * @param newSkip the new skip option
 */
public void setSkip(boolean newSkip){
  set(SKIP_KEY,"String_Node_Str" + newSkip);
}
Program: 141094
Project: 141094
Buggy source:
/** 
 * Set the reference option.
 * @param newReptechGroup the new reference option
 */
public void setReference(String newReference){
  set(REFERENCE_KEY,newReference);
}

Fixed version (ground truth):
/** 
 * Set the reference option.
 * @param newReference the new reference option
 */
public void setReference(String newReference){
  set(REFERENCE_KEY,newReference);
}
Program: 141095
Project: 141095
Buggy source:
/** 
 * Set the buildContrast DEseq2 option.
 * @param newbuildContrast the new buildContrast DEseq2 option
 */
public void setBuildContrast(boolean newBuildContrast){
  set(BUILD_CONTRAST_KEY,"String_Node_Str" + newBuildContrast);
}

Fixed version (ground truth):
/** 
 * Set the buildContrast DEseq2 option.
 * @param newBuildContrast the new buildContrast DEseq2 option
 */
public void setBuildContrast(boolean newBuildContrast){
  set(BUILD_CONTRAST_KEY,"String_Node_Str" + newBuildContrast);
}
Program: 141096
Project: 141096
Buggy source:
/** 
 * Set the reference.
 * @param newReptechGroup the new reference
 */
public void setReference(boolean newReference){
  set(REFERENCE_KEY,"String_Node_Str" + newReference);
}

Fixed version (ground truth):
/** 
 * Set the reference.
 * @param newReference the new reference
 */
public void setReference(boolean newReference){
  set(REFERENCE_KEY,"String_Node_Str" + newReference);
}
Program: 141097
Project: 141097
Buggy source:
/** 
 * Set the reads.
 * @param newReads the new reads
 */
public void setReads(List<String> reads){
  set(READS_KEY,reads);
}

Fixed version (ground truth):
/** 
 * Set the reads.
 * @param newReads the new reads
 */
public void setReads(List<String> newReads){
  set(READS_KEY,newReads);
}
Program: 141098
Project: 141098
Buggy source:
/** 
 * Create a new executable requirement.
 * @param executableName the executable name
 * @param optional true if the executable is a mandatory requirement
 * @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
 * @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;
}
Program: 141100
Project: 141100
Buggy source:
/** 
 * Public constructor
 * @param the Bloom filters
 * @param addedNumberOfElements added number of elements
 * @param expectedNumberOfElements parameter to create bloom filter, must bepositive
 * @param falsePositiveProbability parameter to create bloom filter, must bebetween 0 and 100%
 */
public EnhancedBloomFilter(final BloomFilter<String> bf,final int addedNumberOfElements,final int expectedNumberOfElements,final double falsePositiveProbability){
  if (bf == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.bf=bf.copy();
  this.addedNumberOfElements=addedNumberOfElements;
  this.expectedNumberOfElements=expectedNumberOfElements;
  this.falsePositiveProbability=falsePositiveProbability;
}

Fixed version (ground truth):
/** 
 * Public constructor
 * @param bf the Bloom filters
 * @param addedNumberOfElements added number of elements
 * @param expectedNumberOfElements parameter to create bloom filter, must bepositive
 * @param falsePositiveProbability parameter to create bloom filter, must bebetween 0 and 100%
 */
public EnhancedBloomFilter(final BloomFilter<String> bf,final int addedNumberOfElements,final int expectedNumberOfElements,final double falsePositiveProbability){
  if (bf == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.bf=bf.copy();
  this.addedNumberOfElements=addedNumberOfElements;
  this.expectedNumberOfElements=expectedNumberOfElements;
  this.falsePositiveProbability=falsePositiveProbability;
}
Program: 141101
Project: 141101
Buggy source:
/** 
 * Convert a number of milliseconds into a human reading string.
 * @param time time in ms
 * @return a string with the compact time
 */
public static final String toCompactTime(final long millisSinceEpoch){
  final Calendar cal=Calendar.getInstance(Locale.ENGLISH);
  cal.setTime(new Date(millisSinceEpoch));
  return String.format("String_Node_Str",cal.get(Calendar.YEAR),cal.get(Calendar.MONTH) + 1,cal.get(Calendar.DAY_OF_MONTH),cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE),cal.get(Calendar.SECOND));
}

Fixed version (ground truth):
/** 
 * Convert a number of milliseconds into a human reading string.
 * @param millisSinceEpoch time in ms
 * @return a string with the compact time
 */
public static final String toCompactTime(final long millisSinceEpoch){
  final Calendar cal=Calendar.getInstance(Locale.ENGLISH);
  cal.setTime(new Date(millisSinceEpoch));
  return String.format("String_Node_Str",cal.get(Calendar.YEAR),cal.get(Calendar.MONTH) + 1,cal.get(Calendar.DAY_OF_MONTH),cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE),cal.get(Calendar.SECOND));
}
Program: 141102
Project: 141102
Buggy source:
/** 
 * Create R command.
 * @param rScriptFile the R script file to execute
 * @param sweave true if the script is a Sweave file
 * @param scriprArguments script arguments
 * @return the R command as a list
 */
protected List<String> createCommand(final File rScriptFile,final boolean sweave,final String sweaveOuput,final String... scriptArguments){
  final List<String> result=new ArrayList<>();
  result.add(RSCRIPT_EXECUTABLE);
  if (sweave) {
    result.add("String_Node_Str");
    final StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    sb.append(rScriptFile.getAbsolutePath());
    sb.append('\"');
    if (sweaveOuput != null) {
      sb.append("String_Node_Str");
      sb.append(sweaveOuput);
      sb.append('\"');
    }
    sb.append(')');
    result.add(sb.toString());
  }
 else {
    result.add(rScriptFile.getAbsolutePath());
  }
  if (scriptArguments != null) {
    for (    String argument : scriptArguments) {
      result.add(argument);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Create R command.
 * @param rScriptFile the R script file to execute
 * @param sweave true if the script is a Sweave file
 * @param scriptArguments script arguments
 * @return the R command as a list
 */
protected List<String> createCommand(final File rScriptFile,final boolean sweave,final String sweaveOuput,final String... scriptArguments){
  final List<String> result=new ArrayList<>();
  result.add(RSCRIPT_EXECUTABLE);
  if (sweave) {
    result.add("String_Node_Str");
    final StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    sb.append(rScriptFile.getAbsolutePath());
    sb.append('\"');
    if (sweaveOuput != null) {
      sb.append("String_Node_Str");
      sb.append(sweaveOuput);
      sb.append('\"');
    }
    sb.append(')');
    result.add(sb.toString());
  }
 else {
    result.add(rScriptFile.getAbsolutePath());
  }
  if (scriptArguments != null) {
    for (    String argument : scriptArguments) {
      result.add(argument);
    }
  }
  return result;
}
Program: 141103
Project: 141103
Buggy source:
/** 
 * Execute a R script.
 * @param rScript the source of the script to execute
 * @param sweave true if the script is a Sweave script
 * @param sweaveOutput Sweave output file
 * @param saveRscript true to keep the R script
 * @param description description of the R script
 * @param scriprArguments script arguments
 * @throws IOException if an error occurs while executing the script
 */
void executeRScript(String rScript,boolean sweave,String sweaveOutput,boolean saveRscript,String description,String... scriptArguments) throws IOException ;

Fixed version (ground truth):
/** 
 * Execute a R script.
 * @param rScript the source of the script to execute
 * @param sweave true if the script is a Sweave script
 * @param sweaveOutput Sweave output file
 * @param saveRscript true to keep the R script
 * @param description description of the R script
 * @param scriptArguments script arguments
 * @throws IOException if an error occurs while executing the script
 */
void executeRScript(String rScript,boolean sweave,String sweaveOutput,boolean saveRscript,String description,String... scriptArguments) throws IOException ;
Program: 141104
Project: 141104
Buggy source:
/** 
 * Set the cluster mode.
 * @param clusterMode cluster mode
 */
public void setMode(final EoulsanExecMode mode){
  if (mode == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (this.mode != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.mode=mode;
}

Fixed version (ground truth):
/** 
 * Set the cluster mode.
 * @param mode Eoulsan execution mode
 */
public void setMode(final EoulsanExecMode mode){
  if (mode == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (this.mode != null) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.mode=mode;
}
Program: 141105
Project: 141105
Buggy source:
/** 
 * Configure Log4J. If no log level is provided, the INFO log level will be used.
 * @param logLevel logLevel as string.
 * @param logFile the log file
 */
public static void configureLog4J(final String logLevel,final String logFilename){
  if (logFilename == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Logger rootLogger=Logger.getRootLogger();
  rootLogger.setLevel(Level.toLevel(logLevel,DEFAULT_LOG_LEVEL));
  rootLogger.removeAllAppenders();
  final PatternLayout layout=new PatternLayout("String_Node_Str");
  try {
    final RollingFileAppender fileAppender=new RollingFileAppender(layout,logFilename);
    rootLogger.addAppender(fileAppender);
  }
 catch (  IOException e) {
    EoulsanLogger.getLogger().warning("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Configure Log4J. If no log level is provided, the INFO log level will be used.
 * @param logLevel logLevel as string.
 * @param logFilename the log filename
 */
public static void configureLog4J(final String logLevel,final String logFilename){
  if (logFilename == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Logger rootLogger=Logger.getRootLogger();
  rootLogger.setLevel(Level.toLevel(logLevel,DEFAULT_LOG_LEVEL));
  rootLogger.removeAllAppenders();
  final PatternLayout layout=new PatternLayout("String_Node_Str");
  try {
    final RollingFileAppender fileAppender=new RollingFileAppender(layout,logFilename);
    rootLogger.addAppender(fileAppender);
  }
 catch (  IOException e) {
    EoulsanLogger.getLogger().warning("String_Node_Str");
  }
}
Program: 141106
Project: 141106
Buggy source:
/** 
 * Get the Galaxy tool path.
 * @returnthe Galaxy tool path
 */
public String getGalaxyToolPath(){
  return this.properties.getProperty(GALAXY_TOOL_PATH);
}

Fixed version (ground truth):
/** 
 * Get the Galaxy tool path.
 * @return the Galaxy tool path
 */
public String getGalaxyToolPath(){
  return this.properties.getProperty(GALAXY_TOOL_PATH);
}
Program: 141107
Project: 141107
Buggy source:
/** 
 * Public constructor.
 * @param context the context
 * @param os output stream
 */
public ExpressionRecordWriter(final TaskAttemptContext context,final DataOutputStream out){
  this.context=context;
  this.out=out;
}

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

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

Fixed version (ground truth):
/** 
 * Public constructor.
 * @param context the context
 * @param out data output stream
 */
public SAMRecordWriter(final TaskAttemptContext context,final DataOutputStream out){
  this.context=context;
  this.out=out;
}
Program: 141110
Project: 141110
Buggy source:
/** 
 * Create the prefix of a related task file.
 * @param context the context
 * @return a string with the prefix of the task file
 */
public String getTaskFilePrefix(){
  return getStep().getId() + "String_Node_Str" + getId();
}

Fixed version (ground truth):
/** 
 * Create the prefix of a related task file.
 * @return a string with the prefix of the task file
 */
public String getTaskFilePrefix(){
  return getStep().getId() + "String_Node_Str" + getId();
}
Program: 141111
Project: 141111
Buggy source:
/** 
 * Constructor a new galaxy tool executor.
 * @param context the context
 * @param interpreter the interpreter to use
 * @param commandLine the command line
 * @param toolName the tool name
 * @param toolVersion the tool version
 */
public ToolExecutor(final StepContext context,final ToolData toolData,final String commandLine){
  checkNotNull(commandLine,"String_Node_Str");
  checkNotNull(context,"String_Node_Str");
  this.toolData=toolData;
  this.commandLine=commandLine.trim();
  this.stepContext=context;
  execute();
}

Fixed version (ground truth):
/** 
 * Constructor a new galaxy tool executor.
 * @param context the context
 * @param toolData the tool data
 * @param commandLine the command line
 */
public ToolExecutor(final StepContext context,final ToolData toolData,final String commandLine){
  checkNotNull(commandLine,"String_Node_Str");
  checkNotNull(context,"String_Node_Str");
  this.toolData=toolData;
  this.commandLine=commandLine.trim();
  this.stepContext=context;
  execute();
}
Program: 141112
Project: 141112
Buggy source:
/** 
 * Install the requirement.
 * @throw EoulsanException if the requirement cannot be installed
 */
void install(Progress progress) throws EoulsanException ;

Fixed version (ground truth):
/** 
 * Install the requirement.
 * @throws EoulsanException if the requirement cannot be installed
 */
void install(Progress progress) throws EoulsanException ;
Program: 141113
Project: 141113
Buggy source:
/** 
 * Add a resource paths.
 * @param resourcePath the resource path to add
 */
public void addResourcePaths(final String resourcePaths){
  checkNotNull(resourcePaths,"String_Node_Str");
  for (  String directory : resourcePaths.split("String_Node_Str")) {
    directory=directory.trim();
    if (!directory.isEmpty()) {
      addResourcePath(new DataFile(directory));
    }
  }
}

Fixed version (ground truth):
/** 
 * Add a resource paths.
 * @param resourcePaths the resource path to add
 */
public void addResourcePaths(final String resourcePaths){
  checkNotNull(resourcePaths,"String_Node_Str");
  for (  String directory : resourcePaths.split("String_Node_Str")) {
    directory=directory.trim();
    if (!directory.isEmpty()) {
      addResourcePath(new DataFile(directory));
    }
  }
}
Program: 141114
Project: 141114
Buggy source:
/** 
 * Load all available resources.
 * @param a list with all the loaded resources
 */
public List<S> loadAllResources();

Fixed version (ground truth):
/** 
 * Load all available resources.
 * @return a list with all the loaded resources
 */
public List<S> loadAllResources();
Program: 141115
Project: 141115
Buggy source:
@Override protected void cleanup(final Context context) throws IOException, InterruptedException {
  getLogger().info("String_Node_Str");
  this.samResultsParserThread.join();
  this.process.waitFor();
  this.mapper.throwMappingException();
  if (!this.mapper.isMultipleInstancesEnabled()) {
    this.lock.unlock();
  }
  writeResults(context,this.writeHeaders);
  getLogger().info(this.entriesParsed + "String_Node_Str" + this.mapper.getMapperName()+ "String_Node_Str");
  removeUnusedMapperIndexes(context.getConfiguration());
  getLogger().info("String_Node_Str");
}

Fixed version (ground truth):
@Override protected void cleanup(final Context context) throws IOException, InterruptedException {
  getLogger().info("String_Node_Str");
  this.process.closeEntriesWriter();
  this.samResultsParserThread.join();
  this.process.waitFor();
  this.mapper.throwMappingException();
  if (!this.mapper.isMultipleInstancesEnabled()) {
    this.lock.unlock();
  }
  writeResults(context,this.writeHeaders);
  getLogger().info(this.entriesParsed + "String_Node_Str" + this.mapper.getMapperName()+ "String_Node_Str");
  removeUnusedMapperIndexes(context.getConfiguration());
  getLogger().info("String_Node_Str");
}
Program: 141117
Project: 141117
Buggy source:
@Override public List<S> loadResources(final String resourceName){
  checkNotNull(resourceName,"String_Node_Str");
  if (!this.resources.containsKey(resourceName)) {
    return Collections.emptyList();
  }
  final List<S> result=new ArrayList<>();
  for (  String resourcePath : this.resources.get(resourceName)) {
    try {
      result.add(load(getResourceAsStream(resourcePath)));
    }
 catch (    IOException|EoulsanException e) {
      throw new ServiceConfigurationError(e);
    }
  }
  return Collections.unmodifiableList(result);
}

Fixed version (ground truth):
@Override public List<S> loadResources(final String resourceName){
  checkNotNull(resourceName,"String_Node_Str");
  if (!this.resources.containsKey(resourceName)) {
    return Collections.emptyList();
  }
  final List<S> result=new ArrayList<>();
  for (  String resourcePath : this.resources.get(resourceName)) {
    try {
      result.add(load(getResourceAsStream(resourcePath)));
    }
 catch (    IOException|EoulsanException e) {
      throw new ServiceConfigurationError("String_Node_Str",e);
    }
  }
  return Collections.unmodifiableList(result);
}
Program: 141118
Project: 141118
Buggy source:
@Override public List<S> loadAllResources(){
  final List<S> result=new ArrayList<>();
  for (  String resourcePath : this.resources.values()) {
    try {
      result.add(load(getResourceAsStream(resourcePath)));
    }
 catch (    IOException|EoulsanException e) {
      throw new ServiceConfigurationError(e);
    }
  }
  return Collections.unmodifiableList(result);
}

Fixed version (ground truth):
@Override public List<S> loadAllResources(){
  final List<S> result=new ArrayList<>();
  for (  String resourcePath : this.resources.values()) {
    try {
      result.add(load(getResourceAsStream(resourcePath)));
    }
 catch (    IOException|EoulsanException e) {
      throw new ServiceConfigurationError("String_Node_Str",e);
    }
  }
  return Collections.unmodifiableList(result);
}