nus-yam/ex-repair huggingface dataset:
Program: 188939
Project: 188939
Buggy source:
@Override public List<Experiment> getExperimentsFrom(int studyAccession){
  try {
    JaxbObject<ExperimentList> jaxb=new JaxbObject<ExperimentList>();
    ExperimentList list=(ExperimentList)ll.existsObject("String_Node_Str" + studyAccession + "String_Node_Str","String_Node_Str",jaxb,new ExperimentList());
    return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public List<Experiment> getExperimentsFrom(int studyAccession){
  try {
    JaxbObject<ExperimentList> jaxb=new JaxbObject<ExperimentList>();
    ExperimentList list=(ExperimentList)ll.existsObject("String_Node_Str" + studyAccession + "String_Node_Str","String_Node_Str",jaxb,new ExperimentList());
    if (list != null)     return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}
Program: 188940
Project: 188940
Buggy source:
/** 
 * Use percent sign to designate what should be matched. Eg. SAMPLE_1% will match SAMPLE_1_001 and SAMPLE_1_002 and SAMPLE_1
 * @param name
 * @return
 * @throws IOException
 * @throws JAXBException
 */
private List<Sample> matchSampleName(String name) throws IOException, JAXBException {
  JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
  SampleList list=(SampleList)findObject("String_Node_Str","String_Node_Str" + name,jaxb,new SampleList());
  return list.getList();
}

Fixed version (ground truth):
/** 
 * Use percent sign to designate what should be matched. Eg. SAMPLE_1% will match SAMPLE_1_001 and SAMPLE_1_002 and SAMPLE_1
 * @param name
 * @return
 * @throws IOException
 * @throws JAXBException
 */
private List<Sample> matchSampleName(String name) throws IOException, JAXBException {
  JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
  SampleList list=(SampleList)findObject("String_Node_Str","String_Node_Str" + name,jaxb,new SampleList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188941
Project: 188941
Buggy source:
private List<LibrarySelection> findLibrarySelections() throws IOException, JAXBException {
  JaxbObject<LibrarySelectionList> jaxb=new JaxbObject<LibrarySelectionList>();
  LibrarySelectionList list=(LibrarySelectionList)findObject("String_Node_Str","String_Node_Str",jaxb,new LibrarySelectionList());
  return list.getList();
}

Fixed version (ground truth):
private List<LibrarySelection> findLibrarySelections() throws IOException, JAXBException {
  JaxbObject<LibrarySelectionList> jaxb=new JaxbObject<LibrarySelectionList>();
  LibrarySelectionList list=(LibrarySelectionList)findObject("String_Node_Str","String_Node_Str",jaxb,new LibrarySelectionList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188942
Project: 188942
Buggy source:
private List<Experiment> findExperiments(String searchString) throws IOException, JAXBException {
  JaxbObject<ExperimentList> jaxb=new JaxbObject<ExperimentList>();
  ExperimentList list=(ExperimentList)findObject(searchString,"String_Node_Str",jaxb,new ExperimentList());
  return list.getList();
}

Fixed version (ground truth):
private List<Experiment> findExperiments(String searchString) throws IOException, JAXBException {
  JaxbObject<ExperimentList> jaxb=new JaxbObject<ExperimentList>();
  ExperimentList list=(ExperimentList)findObject(searchString,"String_Node_Str",jaxb,new ExperimentList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188943
Project: 188943
Buggy source:
private List<SequencerRun> findSequencerRuns() throws IOException, JAXBException {
  JaxbObject<SequencerRunList> jaxb=new JaxbObject<SequencerRunList>();
  SequencerRunList list=(SequencerRunList)findObject("String_Node_Str","String_Node_Str",jaxb,new SequencerRunList());
  return list.getList();
}

Fixed version (ground truth):
private List<SequencerRun> findSequencerRuns() throws IOException, JAXBException {
  JaxbObject<SequencerRunList> jaxb=new JaxbObject<SequencerRunList>();
  SequencerRunList list=(SequencerRunList)findObject("String_Node_Str","String_Node_Str",jaxb,new SequencerRunList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188944
Project: 188944
Buggy source:
@Override public List<Sample> getChildSamplesFrom(int parentSampleAccession){
  try {
    JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
    SampleList list=(SampleList)ll.existsObject("String_Node_Str" + parentSampleAccession + "String_Node_Str","String_Node_Str",jaxb,new SampleList());
    return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public List<Sample> getChildSamplesFrom(int parentSampleAccession){
  try {
    JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
    SampleList list=(SampleList)ll.existsObject("String_Node_Str" + parentSampleAccession + "String_Node_Str","String_Node_Str",jaxb,new SampleList());
    if (list != null)     return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}
Program: 188945
Project: 188945
Buggy source:
private List<LibrarySource> findLibrarySources() throws IOException, JAXBException {
  JaxbObject<LibrarySourceList> jaxb=new JaxbObject<LibrarySourceList>();
  LibrarySourceList list=(LibrarySourceList)findObject("String_Node_Str","String_Node_Str",jaxb,new LibrarySourceList());
  return list.getList();
}

Fixed version (ground truth):
private List<LibrarySource> findLibrarySources() throws IOException, JAXBException {
  JaxbObject<LibrarySourceList> jaxb=new JaxbObject<LibrarySourceList>();
  LibrarySourceList list=(LibrarySourceList)findObject("String_Node_Str","String_Node_Str",jaxb,new LibrarySourceList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188946
Project: 188946
Buggy source:
@Override public List<Lane> getLanesFrom(int sequencerRunAccession){
  try {
    JaxbObject<LaneList> jaxb=new JaxbObject<LaneList>();
    LaneList list=(LaneList)ll.existsObject("String_Node_Str" + sequencerRunAccession + "String_Node_Str","String_Node_Str",jaxb,new LaneList());
    return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public List<Lane> getLanesFrom(int sequencerRunAccession){
  try {
    JaxbObject<LaneList> jaxb=new JaxbObject<LaneList>();
    LaneList list=(LaneList)ll.existsObject("String_Node_Str" + sequencerRunAccession + "String_Node_Str","String_Node_Str",jaxb,new LaneList());
    if (list != null)     return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}
Program: 188947
Project: 188947
Buggy source:
@Override public List<Sample> getParentSamplesFrom(int childSampleAccession){
  try {
    JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
    SampleList list=(SampleList)ll.existsObject("String_Node_Str" + childSampleAccession + "String_Node_Str","String_Node_Str",jaxb,new SampleList());
    return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public List<Sample> getParentSamplesFrom(int childSampleAccession){
  try {
    JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
    SampleList list=(SampleList)ll.existsObject("String_Node_Str" + childSampleAccession + "String_Node_Str","String_Node_Str",jaxb,new SampleList());
    if (list != null)     return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}
Program: 188948
Project: 188948
Buggy source:
private List<Platform> findPlatforms() throws IOException, JAXBException {
  JaxbObject<PlatformList> jaxb=new JaxbObject<PlatformList>();
  PlatformList list=(PlatformList)findObject("String_Node_Str","String_Node_Str",jaxb,new PlatformList());
  return list.getList();
}

Fixed version (ground truth):
private List<Platform> findPlatforms() throws IOException, JAXBException {
  JaxbObject<PlatformList> jaxb=new JaxbObject<PlatformList>();
  PlatformList list=(PlatformList)findObject("String_Node_Str","String_Node_Str",jaxb,new PlatformList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188949
Project: 188949
Buggy source:
private List<LibraryStrategy> findLibraryStrategies() throws IOException, JAXBException {
  JaxbObject<LibraryStrategyList> jaxb=new JaxbObject<LibraryStrategyList>();
  LibraryStrategyList list=(LibraryStrategyList)findObject("String_Node_Str","String_Node_Str",jaxb,new LibraryStrategyList());
  return list.getList();
}

Fixed version (ground truth):
private List<LibraryStrategy> findLibraryStrategies() throws IOException, JAXBException {
  JaxbObject<LibraryStrategyList> jaxb=new JaxbObject<LibraryStrategyList>();
  LibraryStrategyList list=(LibraryStrategyList)findObject("String_Node_Str","String_Node_Str",jaxb,new LibraryStrategyList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188950
Project: 188950
Buggy source:
@Override public List<Sample> getSamplesFrom(int experimentAccession){
  try {
    JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
    SampleList list=(SampleList)ll.existsObject("String_Node_Str" + experimentAccession + "String_Node_Str","String_Node_Str",jaxb,new SampleList());
    return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}

Fixed version (ground truth):
@Override public List<Sample> getSamplesFrom(int experimentAccession){
  try {
    JaxbObject<SampleList> jaxb=new JaxbObject<SampleList>();
    SampleList list=(SampleList)ll.existsObject("String_Node_Str" + experimentAccession + "String_Node_Str","String_Node_Str",jaxb,new SampleList());
    if (list != null)     return list.getList();
  }
 catch (  JAXBException ex) {
    Log.error("String_Node_Str",ex);
  }
  return null;
}
Program: 188951
Project: 188951
Buggy source:
private List<Organism> findOrganisms() throws IOException, JAXBException {
  JaxbObject<OrganismList> jaxb=new JaxbObject<OrganismList>();
  OrganismList list=(OrganismList)findObject("String_Node_Str","String_Node_Str",jaxb,new OrganismList());
  return list.getList();
}

Fixed version (ground truth):
private List<Organism> findOrganisms() throws IOException, JAXBException {
  JaxbObject<OrganismList> jaxb=new JaxbObject<OrganismList>();
  OrganismList list=(OrganismList)findObject("String_Node_Str","String_Node_Str",jaxb,new OrganismList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188952
Project: 188952
Buggy source:
private List<Study> findStudies() throws IOException, JAXBException {
  JaxbObject<StudyList> jaxb=new JaxbObject<StudyList>();
  StudyList list=(StudyList)findObject("String_Node_Str","String_Node_Str",jaxb,new StudyList());
  return list.getList();
}

Fixed version (ground truth):
private List<Study> findStudies() throws IOException, JAXBException {
  JaxbObject<StudyList> jaxb=new JaxbObject<StudyList>();
  StudyList list=(StudyList)findObject("String_Node_Str","String_Node_Str",jaxb,new StudyList());
  if (list != null)   return list.getList();
  return null;
}
Program: 188953
Project: 188953
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public ReturnValue do_run(){
  if (options.has("String_Node_Str")) {
    for (    BatchMetadataParser.Field field : BatchMetadataParser.Field.values()) {
      Log.stdout(field.toString());
    }
  }
 else {
    if (options.has("String_Node_Str")) {
      parseFields();
    }
    if (options.has("String_Node_Str")) {
      parseFields();
      String filepath=(String)options.valueOf("String_Node_Str");
      ParseMiseqFile MiseqParser=new ParseMiseqFile(metadata,(Map<String,String>)fields.clone(),interactive);
      try {
        RunInfo run=MiseqParser.parseMiseqFile(filepath);
        inject(run);
      }
 catch (      Exception ex) {
        Log.error("String_Node_Str",ex);
      }
    }
 else {
      Log.stdout("String_Node_Str");
      Log.stdout(this.get_syntax());
      ret.setExitStatus(ReturnValue.INVALIDPARAMETERS);
    }
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public ReturnValue do_run(){
  if (options.has("String_Node_Str")) {
    for (    BatchMetadataParser.Field field : BatchMetadataParser.Field.values()) {
      Log.stdout(field.toString());
    }
  }
 else {
    if (options.has("String_Node_Str")) {
      parseFields();
    }
    if (options.has("String_Node_Str")) {
      parseFields();
      String filepath=(String)options.valueOf("String_Node_Str");
      ParseMiseqFile MiseqParser=new ParseMiseqFile(metadata,(Map<String,String>)fields.clone(),interactive);
      try {
        RunInfo run=MiseqParser.parseMiseqFile(filepath);
        inject(run);
      }
 catch (      Exception ex) {
        Log.error("String_Node_Str",ex);
      }
    }
 else     if (options.has("String_Node_Str")) {
      try {
        parseFields();
        CreateFromScratch create=new CreateFromScratch(metadata,(Map<String,String>)fields.clone(),interactive);
        RunInfo run=create.getRunInfo();
        inject(run);
      }
 catch (      Exception ex) {
        Log.error("String_Node_Str",ex);
      }
    }
 else {
      Log.stdout("String_Node_Str");
      Log.stdout(this.get_syntax());
      ret.setExitStatus(ReturnValue.INVALIDPARAMETERS);
    }
  }
  return ret;
}
Program: 188954
Project: 188954
Buggy source:
public BatchMetadataParser(Metadata metadata,Map<String,String> fields,boolean interactive){
  this.metadata=metadata;
  this.fields=fields;
  this.interactive=interactive;
}

Fixed version (ground truth):
public BatchMetadataParser(Metadata metadata,Map<String,String> fields,boolean interactive){
  this.metadata=metadata;
  this.fields=fields;
  this.defaults=new HashMap<String,String>(fields);
  this.interactive=interactive;
}
Program: 188956
Project: 188956
Buggy source:
protected String choiceOf(String sampleName,String title,String[] choices,String deflt){
  String choice="String_Node_Str";
  int choiceInt=0;
  Log.stdout("String_Node_Str" + sampleName + "String_Node_Str"+ title+ "String_Node_Str");
  for (int i=1; i <= choices.length; i++) {
    Log.stdout(i + "String_Node_Str" + choices[i - 1]);
    if (deflt.equals(choices[i - 1])) {
      choiceInt=i;
    }
  }
  while (choice == null || choice.isEmpty()) {
    choiceInt=ConsoleAdapter.getInstance().promptInteger(title,choiceInt);
    if (choiceInt == 0) {
    }
 else     if (choiceInt == choices.length) {
      choice=ConsoleAdapter.getInstance().promptString("String_Node_Str",null);
    }
 else     if (choiceInt <= 0 || choiceInt > choices.length) {
      Log.stdout("String_Node_Str");
    }
 else {
      choice=choices[choiceInt - 1];
    }
  }
  return choice;
}

Fixed version (ground truth):
/** 
 * Handles prompting for a choice out of a list of choices using integers.
 * @param sampleName the sample name used for the prompting message
 * @param title the name of the field that is being set
 * @param choices the list of choices for the value of 'title'
 * @param deflt the default choice to fall back on, which can be one of thelist of 'choices'. This is the string value, not the integer.
 * @return
 */
protected String choiceOf(String sampleName,String title,String[] choices,String deflt){
  String choice=null;
  int choiceInt=0;
  Log.stdout("String_Node_Str" + sampleName + "String_Node_Str"+ title+ "String_Node_Str");
  for (int i=1; i <= choices.length; i++) {
    Log.stdout(i + "String_Node_Str" + choices[i - 1]);
    if (deflt.equals(choices[i - 1])) {
      choiceInt=i;
    }
  }
  while (choice == null) {
    choiceInt=ConsoleAdapter.getInstance().promptInteger(title,choiceInt);
    if (choiceInt == 0) {
      break;
    }
 else     if (choiceInt == choices.length) {
      choice=ConsoleAdapter.getInstance().promptString("String_Node_Str",null);
    }
 else     if (choiceInt <= 0 || choiceInt > choices.length) {
      Log.stdout("String_Node_Str");
    }
 else {
      choice=choices[choiceInt - 1];
    }
  }
  return choice;
}
Program: 188957
Project: 188957
Buggy source:
protected String prompt(String sampleName,String title,String[] choices,String deflt,Field fieldName){
  Log.debug("String_Node_Str" + sampleName + "String_Node_Str");
  if (fieldName != null && fields.containsKey(fieldName.toString())) {
    return fields.get(fieldName.toString());
  }
 else   if (!interactive) {
    if (deflt != null && !deflt.trim().isEmpty()) {
      return deflt;
    }
 else {
      throw new OptionException(fields.keySet(),new Exception("String_Node_Str" + fieldName.toString())){
      }
;
    }
  }
 else {
    String s=choiceOf(sampleName,title,choices,deflt);
    if (fieldName != null) {
      fields.put(fieldName.toString(),s);
    }
    return s;
  }
}

Fixed version (ground truth):
/** 
 * Determine a value for a field 'title' of sample 'sampleName'. This method has different functionality depending on whether the Field is set (can be null), or the 'interactive' option is on.
 * @param sampleName the sample name used for prompting
 * @param title the name of the field being set
 * @param choices the list of choices (Strings) that the user can selectfrom in interactive mode
 * @param deflt the default string if everything else fails
 * @param fieldName the Field that is used for command-line defaults.
 * @return the choice for the field, or an OptionException if other methodsfail. This method can return null.
 */
protected String prompt(String sampleName,String title,String[] choices,String deflt,Field fieldName){
  Log.debug("String_Node_Str" + sampleName + "String_Node_Str");
  deflt=extractDefault(fieldName,deflt);
  if (!interactive) {
    return returnDefault(((deflt != null && !deflt.trim().isEmpty())),deflt,title,fieldName);
  }
 else {
    String s=choiceOf(sampleName,title,choices,deflt);
    if (fieldName != null) {
      defaults.put(fieldName.toString(),s);
    }
    return s;
  }
}
Program: 188958
Project: 188958
Buggy source:
@Test public void testLaunchingWithWait() throws IOException {
  Map<String,File> iniParams=exportWorkflowInis();
  String localhost=ITUtility.getLocalhost();
  Log.info("String_Node_Str" + localhost);
  Map<String,Integer> wr_accessions=new HashMap<String,Integer>();
  for (  Entry<String,File> e : bundleLocations.entrySet()) {
    Log.info("String_Node_Str" + e.getKey());
    String workflowPath=iniParams.get(e.getKey()).getAbsolutePath();
    String accession=Integer.toString(installedWorkflows.get(e.getKey()));
    String listCommand="String_Node_Str" + workflowPath + "String_Node_Str"+ accession+ "String_Node_Str"+ localhost;
    String listOutput=ITUtility.runSeqWareJar(listCommand,ReturnValue.SUCCESS);
    Log.info(listOutput);
  }
}

Fixed version (ground truth):
@Test public void testLaunchingWithWait() throws IOException {
  Map<String,File> iniParams=exportWorkflowInis();
  String localhost=ITUtility.getLocalhost();
  Log.info("String_Node_Str" + localhost);
  Map<String,Integer> wr_accessions=new HashMap<String,Integer>();
  for (  Entry<String,File> e : bundleLocations.entrySet()) {
    Log.info("String_Node_Str" + e.getKey());
    String workflowPath=iniParams.get(e.getKey()).getAbsolutePath();
    String accession=Integer.toString(installedWorkflows.get(e.getKey()));
    String listCommand="String_Node_Str" + workflowPath + "String_Node_Str"+ accession+ "String_Node_Str"+ PARENT+ "String_Node_Str"+ localhost;
    String listOutput=ITUtility.runSeqWareJar(listCommand,ReturnValue.SUCCESS);
    Log.info(listOutput);
  }
}
Program: 188959
Project: 188959
Buggy source:
public static void main(String[] args) throws IOException {
  PluginRunnerIT it=new PluginRunnerIT();
  List<Integer> list=new ArrayList<Integer>();
  for (  String acc : args) {
    try {
      Integer accInt=Integer.valueOf(acc);
      list.add(accInt);
    }
 catch (    NumberFormatException e) {
      Log.stdout("String_Node_Str");
    }
  }
  it.testLatestWorkflows(list);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  PluginRunnerIT it=new PluginRunnerIT();
  List<Integer> list=new ArrayList<Integer>();
  for (  String acc : args) {
    try {
      Integer accInt=Integer.valueOf(acc);
      list.add(accInt);
    }
 catch (    NumberFormatException e) {
      Log.stdout("String_Node_Str");
    }
  }
  it.testLatestWorkflowsInternal(list);
}
Program: 188961
Project: 188961
Buggy source:
@Test public void testLaunchingWithoutWait() throws IOException {
  Map<String,File> iniParams=exportWorkflowInis();
  String localhost=ITUtility.getLocalhost();
  Log.info("String_Node_Str" + localhost);
  Map<String,Integer> wr_accessions=new HashMap<String,Integer>();
  for (  Entry<String,File> e : bundleLocations.entrySet()) {
    Log.info("String_Node_Str" + e.getKey());
    String workflowPath=iniParams.get(e.getKey()).getAbsolutePath();
    String accession=Integer.toString(installedWorkflows.get(e.getKey()));
    String listCommand="String_Node_Str" + workflowPath + "String_Node_Str"+ accession+ "String_Node_Str"+ localhost;
    String listOutput=ITUtility.runSeqWareJar(listCommand,ReturnValue.SUCCESS);
    Log.info(listOutput);
  }
}

Fixed version (ground truth):
@Test public void testLaunchingWithoutWait() throws IOException {
  Map<String,File> iniParams=exportWorkflowInis();
  String localhost=ITUtility.getLocalhost();
  Log.info("String_Node_Str" + localhost);
  Map<String,Integer> wr_accessions=new HashMap<String,Integer>();
  for (  Entry<String,File> e : bundleLocations.entrySet()) {
    Log.info("String_Node_Str" + e.getKey());
    String workflowPath=iniParams.get(e.getKey()).getAbsolutePath();
    String accession=Integer.toString(installedWorkflows.get(e.getKey()));
    String listCommand="String_Node_Str" + workflowPath + "String_Node_Str"+ accession+ "String_Node_Str"+ PARENT+ "String_Node_Str"+ localhost;
    String listOutput=ITUtility.runSeqWareJar(listCommand,ReturnValue.SUCCESS);
    Log.info(listOutput);
  }
}
Program: 188962
Project: 188962
Buggy source:
@Test public void testLatestWorkflows(List<Integer> accessions) throws IOException {
  String output=ITUtility.runSeqWareJar("String_Node_Str",ReturnValue.SUCCESS);
  Assert.assertTrue("String_Node_Str",output.contains("String_Node_Str"));
  Map<String,WorkflowInfo> latestWorkflows=new HashMap<String,WorkflowInfo>();
  String[] lines=output.split(System.getProperty("String_Node_Str"));
  for (  String line : lines) {
    String[] lineParts=line.split("String_Node_Str");
    try {
      int workflow_accession=Integer.valueOf(lineParts[3]);
      String workflowName=lineParts[0];
      String path=lineParts[4];
      if (path.equals("String_Node_Str")) {
        continue;
      }
      WorkflowInfo wi=new WorkflowInfo(workflow_accession,path,workflowName,lineParts[1]);
      File fileAtPath=new File(path);
      if (!fileAtPath.exists()) {
        Log.warn("String_Node_Str" + workflowName + "String_Node_Str"+ workflow_accession+ "String_Node_Str"+ path);
        continue;
      }
      if (!latestWorkflows.containsKey(workflowName)) {
        latestWorkflows.put(workflowName,wi);
      }
 else {
        int old=latestWorkflows.get(workflowName).sw_accession;
        if (workflow_accession > old) {
          latestWorkflows.put(workflowName,wi);
        }
      }
    }
 catch (    Exception e) {
    }
  }
  ExecutorService threadPool=Executors.newFixedThreadPool(latestWorkflows.size());
  CompletionService<String> pool=new ExecutorCompletionService<String>(threadPool);
  for (  Entry<String,WorkflowInfo> e : latestWorkflows.entrySet()) {
    System.out.println("String_Node_Str" + e.getKey() + "String_Node_Str"+ e.getValue().sw_accession);
    if (accessions.size() > 0) {
      Integer acc=e.getValue().sw_accession;
      if (!accessions.contains(acc)) {
        System.out.println("String_Node_Str" + e.getKey() + "String_Node_Str"+ e.getValue().sw_accession+ "String_Node_Str");
        continue;
      }
    }
    StringBuilder params=new StringBuilder();
    params.append("String_Node_Str").append(e.getValue().path).append("String_Node_Str");
    params.append("String_Node_Str").append(e.getValue().version).append("String_Node_Str");
    params.append("String_Node_Str");
    File tempFile=File.createTempFile(e.getValue().name,"String_Node_Str");
    pool.submit(new TestingThread(params.toString(),tempFile));
  }
  for (  Entry<String,WorkflowInfo> e : latestWorkflows.entrySet()) {
    try {
      pool.take().get();
    }
 catch (    InterruptedException ex) {
      Log.error(ex);
    }
catch (    ExecutionException ex) {
      Log.error(ex);
    }
  }
  threadPool.shutdown();
}

Fixed version (ground truth):
@Test public void testLatestWorkflows() throws IOException {
  testLatestWorkflowsInternal(new ArrayList<Integer>());
}
Program: 188963
Project: 188963
Buggy source:
@Test public void testLaunchingWithWaitAndNoMetadata() throws IOException {
  Map<String,File> iniParams=exportWorkflowInis();
  String localhost=ITUtility.getLocalhost();
  Log.info("String_Node_Str" + localhost);
  Map<String,Integer> wr_accessions=new HashMap<String,Integer>();
  for (  Entry<String,File> e : bundleLocations.entrySet()) {
    Log.info("String_Node_Str" + e.getKey());
    String workflowPath=iniParams.get(e.getKey()).getAbsolutePath();
    String accession=Integer.toString(installedWorkflows.get(e.getKey()));
    String listCommand="String_Node_Str" + workflowPath + "String_Node_Str"+ accession+ "String_Node_Str"+ localhost;
    String listOutput=ITUtility.runSeqWareJar(listCommand,ReturnValue.SUCCESS);
    Log.info(listOutput);
  }
}

Fixed version (ground truth):
@Test public void testLaunchingWithWaitAndNoMetadata() throws IOException {
  Map<String,File> iniParams=exportWorkflowInis();
  String localhost=ITUtility.getLocalhost();
  Log.info("String_Node_Str" + localhost);
  Map<String,Integer> wr_accessions=new HashMap<String,Integer>();
  for (  Entry<String,File> e : bundleLocations.entrySet()) {
    Log.info("String_Node_Str" + e.getKey());
    String workflowPath=iniParams.get(e.getKey()).getAbsolutePath();
    String accession=Integer.toString(installedWorkflows.get(e.getKey()));
    String listCommand="String_Node_Str" + workflowPath + "String_Node_Str"+ accession+ "String_Node_Str"+ PARENT+ "String_Node_Str"+ localhost;
    String listOutput=ITUtility.runSeqWareJar(listCommand,ReturnValue.SUCCESS);
    Log.info(listOutput);
  }
}
Program: 188964
Project: 188964
Buggy source:
/** 
 * reads a map and tries to find the parent accessions, the result is de-duplicated.
 * @param map
 * @return
 */
private ArrayList<String> parseParentAccessions(Map<String,String> map){
  ArrayList<String> results=new ArrayList<String>();
  HashMap<String,String> resultsDeDup=new HashMap<String,String>();
  for (  String key : map.keySet()) {
    if ("String_Node_Str".equals(key) || "String_Node_Str".equals(key) || "String_Node_Str".equals(key)) {
      resultsDeDup.put(map.get(key),"String_Node_Str");
    }
  }
  for (  String accession : resultsDeDup.keySet()) {
    results.add(accession);
  }
  return (results);
}

Fixed version (ground truth):
/** 
 * reads a map and tries to find the parent accessions, the result is de-duplicated.
 * @param map
 * @return
 */
private ArrayList<String> parseParentAccessions(Map<String,String> map){
  ArrayList<String> results=new ArrayList<String>();
  HashMap<String,String> resultsDeDup=new HashMap<String,String>();
  for (  String key : map.keySet()) {
    if ("String_Node_Str".equals(key) || "String_Node_Str".equals(key) || "String_Node_Str".equals(key)) {
      resultsDeDup.put(map.get(key),"String_Node_Str");
    }
  }
  for (  String accession : resultsDeDup.keySet()) {
    results.add(accession);
  }
  if (results.contains("String_Node_Str") && results.size() > 1) {
    results.remove("String_Node_Str");
  }
  return (results);
}
Program: 188965
Project: 188965
Buggy source:
/** 
 * <p>get.</p>
 * @return a {@link net.sourceforge.seqware.common.metadata.MetadataDB} object.
 */
public static MetadataDB get(){
  try {
    if (db != null && ((db.getDb() != null && db.getDb().isClosed()))) {
      db.clean_up();
      db=null;
    }
  }
 catch (  SQLException ex) {
    Log.error("String_Node_Str",ex);
  }
  if (db == null) {
    db=new MetadataDB();
    DataSource ds=null;
    try {
      InitialContext initCtx=new InitialContext();
      ds=(DataSource)initCtx.lookup("String_Node_Str");
    }
 catch (    NamingException ex) {
      Log.fatal(ex);
      ex.printStackTrace();
    }
    if (ds != null) {
      db.init(ds);
    }
 else {
      Map<String,String> settings=null;
      try {
        settings=ConfigTools.getSettings();
        String connection="String_Node_Str" + settings.get("String_Node_Str") + "String_Node_Str"+ settings.get("String_Node_Str");
        String user=settings.get("String_Node_Str");
        String pass=settings.get("String_Node_Str");
        Log.debug("String_Node_Str" + user + "String_Node_Str"+ pass+ "String_Node_Str"+ connection);
        db.init(connection,user,pass);
      }
 catch (      Exception ex) {
        Logger.getLogger(DBAccess.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
  return db;
}

Fixed version (ground truth):
/** 
 * <p>get.</p>
 * @return a {@link net.sourceforge.seqware.common.metadata.MetadataDB} object.
 */
public synchronized static MetadataDB get(){
  try {
    if (metadataDBWrapper.get() != null && ((metadataDBWrapper.get().getDb() != null && metadataDBWrapper.get().getDb().isClosed()))) {
      metadataDBWrapper.get().clean_up();
      metadataDBWrapper.set(null);
    }
  }
 catch (  SQLException ex) {
    Log.error("String_Node_Str",ex);
  }
  if (metadataDBWrapper.get() == null) {
    metadataDBWrapper.set(new MetadataDB());
    DataSource ds=null;
    try {
      InitialContext initCtx=new InitialContext();
      ds=(DataSource)initCtx.lookup("String_Node_Str");
    }
 catch (    NamingException ex) {
      Log.fatal(ex);
      ex.printStackTrace();
    }
    if (ds != null) {
      Log.debug("String_Node_Str");
      metadataDBWrapper.get().init(ds);
    }
 else {
      Log.debug("String_Node_Str");
      Map<String,String> settings=null;
      try {
        settings=ConfigTools.getSettings();
        String connection="String_Node_Str" + settings.get("String_Node_Str") + "String_Node_Str"+ settings.get("String_Node_Str");
        String user=settings.get("String_Node_Str");
        String pass=settings.get("String_Node_Str");
        Log.debug("String_Node_Str" + user + "String_Node_Str"+ pass+ "String_Node_Str"+ connection);
        metadataDBWrapper.get().init(connection,user,pass);
      }
 catch (      Exception ex) {
        Log.fatal("String_Node_Str",ex);
        Logger.getLogger(DBAccess.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
  Log.debug(metadataDBWrapper.get().toString() + "String_Node_Str");
  return metadataDBWrapper.get();
}
Program: 188966
Project: 188966
Buggy source:
/** 
 * <p>close.</p>
 */
public static void close(){
  if (db != null) {
    db.clean_up();
    db=null;
  }
}

Fixed version (ground truth):
/** 
 * <p>close.</p>
 */
public synchronized static void close(){
  if (metadataDBWrapper.get() != null) {
    Log.debug(metadataDBWrapper.get().toString() + "String_Node_Str");
    metadataDBWrapper.get().clean_up();
    metadataDBWrapper.set(null);
  }
}
Program: 188967
Project: 188967
Buggy source:
/** 
 * <p>Setter for the field <code>sql</code>.</p>
 * @param sql a {@link java.sql.Statement} object.
 */
public void setSql(Statement sql){
  this.sql=sql;
}

Fixed version (ground truth):
/** 
 * <p>Setter for the field <code>sql</code>.</p>
 * @param sql a {@link java.sql.Statement} object.
 */
public void setSql(Statement sql){
  if (sql == null) {
    Log.fatal("String_Node_Str");
  }
  this.sql=sql;
}
Program: 188968
Project: 188968
Buggy source:
private ReturnValue init(){
  try {
    DatabaseMetaData foo2=this.getDb().getMetaData();
    this.setDbmd(foo2);
    this.setDbmd(this.getDb().getMetaData());
  }
 catch (  SQLException e) {
    return new ReturnValue(null,"String_Node_Str" + e.getMessage(),ReturnValue.DBCOULDNOTINITIALIZE);
  }
  try {
    this.setSql(this.getDb().createStatement());
  }
 catch (  SQLException e) {
    return new ReturnValue(null,"String_Node_Str" + e.getMessage(),ReturnValue.SQLQUERYFAILED);
  }
  try {
    return new ReturnValue(null,"String_Node_Str" + dbmd.getDatabaseProductName() + "String_Node_Str"+ dbmd.getDatabaseProductVersion()+ "String_Node_Str",ReturnValue.SUCCESS);
  }
 catch (  SQLException e) {
    return new ReturnValue(null,"String_Node_Str" + e.getMessage(),ReturnValue.DBCOULDNOTINITIALIZE);
  }
}

Fixed version (ground truth):
private ReturnValue init(){
  try {
    DatabaseMetaData foo2=this.getDb().getMetaData();
    this.setDbmd(foo2);
    this.setDbmd(this.getDb().getMetaData());
  }
 catch (  SQLException e) {
    return new ReturnValue(null,"String_Node_Str" + e.getMessage(),ReturnValue.DBCOULDNOTINITIALIZE);
  }
  Log.debug("String_Node_Str");
  try {
    this.setSql(this.getDb().createStatement());
  }
 catch (  SQLException e) {
    Log.debug("String_Node_Str",e);
    return new ReturnValue(null,"String_Node_Str" + e.getMessage(),ReturnValue.SQLQUERYFAILED);
  }
  Log.debug("String_Node_Str" + this.toString());
  try {
    return new ReturnValue(null,"String_Node_Str" + dbmd.getDatabaseProductName() + "String_Node_Str"+ dbmd.getDatabaseProductVersion()+ "String_Node_Str",ReturnValue.SUCCESS);
  }
 catch (  SQLException e) {
    return new ReturnValue(null,"String_Node_Str" + e.getMessage(),ReturnValue.DBCOULDNOTINITIALIZE);
  }
}
Program: 188969
Project: 188969
Buggy source:
/** 
 * <p>executeQuery.</p>
 * @param s a {@link java.lang.String} object.
 * @return a {@link java.sql.ResultSet} object.
 * @throws java.sql.SQLException if any.
 */
public ResultSet executeQuery(String s) throws SQLException {
  logger.debug("String_Node_Str" + s);
  return getSql().executeQuery(s);
}

Fixed version (ground truth):
/** 
 * <p>executeQuery.</p>
 * @param s a {@link java.lang.String} object.
 * @return a {@link java.sql.ResultSet} object.
 * @throws java.sql.SQLException if any.
 */
public ResultSet executeQuery(String s) throws SQLException {
  Statement sql1=getSql();
  logger.debug("String_Node_Str" + s + "String_Node_Str");
  logger.debug("String_Node_Str" + (s == null ? "String_Node_Str" : "String_Node_Str"));
  logger.debug("String_Node_Str" + (sql1 == null ? "String_Node_Str" : "String_Node_Str"));
  return sql1.executeQuery(s);
}
Program: 188970
Project: 188970
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public ReturnValue clean_up(){
  ReturnValue ret=new ReturnValue();
  try {
    if (this.getSql() != null) {
      this.getSql().close();
    }
    if (this.getDb() != null) {
      this.getDb().close();
    }
  }
 catch (  SQLException e) {
    ret.setStderr("String_Node_Str" + e.getMessage());
    ret.setExitStatus(ReturnValue.DBCOULDNOTDISCONNECT);
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public ReturnValue clean_up(){
  Log.debug("String_Node_Str" + this.toString());
  ReturnValue ret=new ReturnValue();
  try {
    if (this.getSql() != null) {
      this.getSql().close();
    }
    if (this.getDb() != null) {
      this.getDb().close();
    }
  }
 catch (  SQLException e) {
    ret.setStderr("String_Node_Str" + e.getMessage());
    ret.setExitStatus(ReturnValue.DBCOULDNOTDISCONNECT);
  }
  return ret;
}
Program: 188971
Project: 188971
Buggy source:
private void addNewSamples(Processing p) throws SQLException, ResourceException {
  Set<Integer> newObj=new HashSet<Integer>();
  for (  Sample obj : p.getSamples()) {
    newObj.add(obj.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newObj.remove(swa);
  }
  for (  int objID : newObj) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(objID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ objID);
    }
  }
}

Fixed version (ground truth):
private void addNewSamples(Processing p) throws SQLException, ResourceException {
  Log.debug("String_Node_Str" + p.toString());
  Set<Integer> newObj=new HashSet<Integer>();
  for (  Sample obj : p.getSamples()) {
    newObj.add(obj.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newObj.remove(swa);
  }
  for (  int objID : newObj) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(objID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ objID);
    }
  }
}
Program: 188972
Project: 188972
Buggy source:
private void addNewExperiments(Processing p) throws SQLException, ResourceException {
  Set<Integer> newObj=new HashSet<Integer>();
  for (  Experiment obj : p.getExperiments()) {
    newObj.add(obj.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newObj.remove(swa);
  }
  for (  int objID : newObj) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(objID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ objID);
    }
  }
}

Fixed version (ground truth):
private void addNewExperiments(Processing p) throws SQLException, ResourceException {
  Log.debug("String_Node_Str" + p.toString());
  Set<Integer> newObj=new HashSet<Integer>();
  for (  Experiment obj : p.getExperiments()) {
    newObj.add(obj.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newObj.remove(swa);
  }
  for (  int objID : newObj) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(objID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ objID);
    }
  }
}
Program: 188973
Project: 188973
Buggy source:
private void addNewRelationships(Processing p) throws SQLException {
  Set<Processing> children=p.getChildren();
  Set<Processing> parents=p.getParents();
  Set<Integer> newParents=new HashSet<Integer>();
  for (  Processing pr : parents) {
    newParents.add(pr.getProcessingId());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int parent=rs.getInt("String_Node_Str");
    newParents.remove(parent);
  }
  Set<Integer> newChildren=new HashSet<Integer>();
  for (  Processing pr : children) {
    newChildren.add(pr.getProcessingId());
  }
  rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int child=rs.getInt("String_Node_Str");
    newParents.remove(child);
  }
  int[] parentArr=new int[newParents.size()];
  int i=0;
  for (Iterator<Integer> iterator=newParents.iterator(); iterator.hasNext(); i++) {
    parentArr[i]=iterator.next();
  }
  int[] childArr=new int[newChildren.size()];
  i=0;
  for (Iterator<Integer> iterator=newChildren.iterator(); iterator.hasNext(); i++) {
    childArr[i]=iterator.next();
  }
  ReturnValue ret=DBAccess.get().associate_processing_event_with_parents_and_child(p.getProcessingId(),parentArr,childArr);
  if (ret.getExitStatus() != ReturnValue.SUCCESS) {
    throw new ResourceException(Status.SERVER_ERROR_INTERNAL,"String_Node_Str" + ret.getExitStatus());
  }
}

Fixed version (ground truth):
private void addNewRelationships(Processing p) throws SQLException {
  Log.debug("String_Node_Str" + p.toString());
  Set<Processing> children=p.getChildren();
  Set<Processing> parents=p.getParents();
  Set<Integer> newParents=new HashSet<Integer>();
  for (  Processing pr : parents) {
    newParents.add(pr.getProcessingId());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int parent=rs.getInt("String_Node_Str");
    newParents.remove(parent);
  }
  Set<Integer> newChildren=new HashSet<Integer>();
  for (  Processing pr : children) {
    newChildren.add(pr.getProcessingId());
  }
  rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int child=rs.getInt("String_Node_Str");
    newParents.remove(child);
  }
  int[] parentArr=new int[newParents.size()];
  int i=0;
  for (Iterator<Integer> iterator=newParents.iterator(); iterator.hasNext(); i++) {
    parentArr[i]=iterator.next();
  }
  int[] childArr=new int[newChildren.size()];
  i=0;
  for (Iterator<Integer> iterator=newChildren.iterator(); iterator.hasNext(); i++) {
    childArr[i]=iterator.next();
  }
  ReturnValue ret=DBAccess.get().associate_processing_event_with_parents_and_child(p.getProcessingId(),parentArr,childArr);
  if (ret.getExitStatus() != ReturnValue.SUCCESS) {
    throw new ResourceException(Status.SERVER_ERROR_INTERNAL,"String_Node_Str" + ret.getExitStatus());
  }
}
Program: 188974
Project: 188974
Buggy source:
private void addNewIUSes(Processing p) throws SQLException, ResourceException {
  Set<Integer> newIUSswa=new HashSet<Integer>();
  for (  IUS ius : p.getIUS()) {
    newIUSswa.add(ius.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newIUSswa.remove(swa);
  }
  for (  int swa : newIUSswa) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(swa,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ swa);
    }
  }
}

Fixed version (ground truth):
private void addNewIUSes(Processing p) throws SQLException, ResourceException {
  Log.debug("String_Node_Str" + p.toString());
  Set<Integer> newIUSswa=new HashSet<Integer>();
  for (  IUS ius : p.getIUS()) {
    newIUSswa.add(ius.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newIUSswa.remove(swa);
  }
  for (  int swa : newIUSswa) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(swa,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ swa);
    }
  }
}
Program: 188975
Project: 188975
Buggy source:
private void addNewFiles(Processing p) throws SQLException, ResourceException {
  Set<Integer> newFiles=new HashSet<Integer>();
  for (  File file : p.getFiles()) {
    newFiles.add(file.getFileId());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int fileID=rs.getInt("String_Node_Str");
    newFiles.remove(fileID);
  }
  for (  int fileID : newFiles) {
    DBAccess.get().linkProcessingAndFile(p.getProcessingId(),fileID);
  }
}

Fixed version (ground truth):
private void addNewFiles(Processing p) throws SQLException, ResourceException {
  Log.debug("String_Node_Str" + p.toString());
  Set<Integer> newFiles=new HashSet<Integer>();
  for (  File file : p.getFiles()) {
    newFiles.add(file.getFileId());
  }
  Log.debug("String_Node_Str" + newFiles.size() + "String_Node_Str");
  String query="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ p.getProcessingId();
  Log.debug("String_Node_Str" + query);
  ResultSet rs=DBAccess.get().executeQuery(query);
  while (rs.next()) {
    int fileID=rs.getInt("String_Node_Str");
    newFiles.remove(fileID);
  }
  for (  int fileID : newFiles) {
    Log.debug("String_Node_Str" + fileID + "String_Node_Str"+ p.getSwAccession());
    DBAccess.get().linkProcessingAndFile(p.getProcessingId(),fileID);
  }
}
Program: 188976
Project: 188976
Buggy source:
private void addNewLanes(Processing p) throws SQLException, ResourceException {
  Set<Integer> newLane=new HashSet<Integer>();
  for (  Lane lane : p.getLanes()) {
    newLane.add(lane.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newLane.remove(swa);
  }
  for (  int laneID : newLane) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(laneID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ laneID);
    }
  }
}

Fixed version (ground truth):
private void addNewLanes(Processing p) throws SQLException, ResourceException {
  Log.debug("String_Node_Str" + p.toString());
  Set<Integer> newLane=new HashSet<Integer>();
  for (  Lane lane : p.getLanes()) {
    newLane.add(lane.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newLane.remove(swa);
  }
  for (  int laneID : newLane) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(laneID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ laneID);
    }
  }
}
Program: 188977
Project: 188977
Buggy source:
private void addNewStudies(Processing p) throws SQLException, ResourceException {
  Set<Integer> newObj=new HashSet<Integer>();
  for (  Study obj : p.getStudies()) {
    newObj.add(obj.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newObj.remove(swa);
  }
  for (  int objID : newObj) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(objID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ objID);
    }
  }
}

Fixed version (ground truth):
private void addNewStudies(Processing p) throws SQLException, ResourceException {
  Log.debug("String_Node_Str" + p.toString());
  Set<Integer> newObj=new HashSet<Integer>();
  for (  Study obj : p.getStudies()) {
    newObj.add(obj.getSwAccession());
  }
  ResultSet rs=DBAccess.get().executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ p.getProcessingId());
  while (rs.next()) {
    int swa=rs.getInt("String_Node_Str");
    newObj.remove(swa);
  }
  for (  int objID : newObj) {
    boolean toReturn=DBAccess.get().linkAccessionAndParent(objID,p.getProcessingId());
    if (!toReturn) {
      throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,"String_Node_Str" + toReturn + "String_Node_Str"+ objID);
    }
  }
}