Program: 52083
Project: 52083
Buggy source:
public static Record convertCrossRefDomToRecord(Element pubArticle){
  MutableRecord record=new SubmissionLookupPublication("String_Node_Str");
  Map<String,String> mounthToNum=new HashMap<String,String>();
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  Element medline=XMLUtils.getSingleElement(pubArticle,"String_Node_Str");
  Element article=XMLUtils.getSingleElement(medline,"String_Node_Str");
  Element pubmed=XMLUtils.getSingleElement(pubArticle,"String_Node_Str");
  Element identifierList=XMLUtils.getSingleElement(pubmed,"String_Node_Str");
  if (identifierList != null) {
    List<Element> identifiers=XMLUtils.getElementList(identifierList,"String_Node_Str");
    if (identifiers != null) {
      for (      Element id : identifiers) {
        if ("String_Node_Str".equals(id.getAttribute("String_Node_Str"))) {
          String pubmedID=id.getTextContent().trim();
          if (pubmedID != null)           record.addValue("String_Node_Str",new StringValue(pubmedID));
        }
 else         if ("String_Node_Str".equals(id.getAttribute("String_Node_Str"))) {
          String doi=id.getTextContent().trim();
          if (doi != null)           record.addValue("String_Node_Str",new StringValue(doi));
        }
      }
    }
  }
  String status=XMLUtils.getElementValue(pubmed,"String_Node_Str");
  if (status != null)   record.addValue("String_Node_Str",new StringValue(status));
  String pubblicationModel=XMLUtils.getElementAttribute(medline,"String_Node_Str","String_Node_Str");
  if (pubblicationModel != null)   record.addValue("String_Node_Str",new StringValue(pubblicationModel));
  String title=XMLUtils.getElementValue(article,"String_Node_Str");
  if (title != null)   record.addValue("String_Node_Str",new StringValue(title));
  Element abstractElement=XMLUtils.getSingleElement(medline,"String_Node_Str");
  if (abstractElement == null) {
    abstractElement=XMLUtils.getSingleElement(medline,"String_Node_Str");
  }
  if (abstractElement != null) {
    String summary=XMLUtils.getElementValue(abstractElement,"String_Node_Str");
    if (summary != null)     record.addValue("String_Node_Str",new StringValue(summary));
  }
  List<String[]> authors=new LinkedList<String[]>();
  Element authorList=XMLUtils.getSingleElement(article,"String_Node_Str");
  if (authorList != null) {
    List<Element> authorsElement=XMLUtils.getElementList(authorList,"String_Node_Str");
    if (authorsElement != null) {
      for (      Element author : authorsElement) {
        if (StringUtils.isBlank(XMLUtils.getElementValue(author,"String_Node_Str"))) {
          authors.add(new String[]{XMLUtils.getElementValue(author,"String_Node_Str"),XMLUtils.getElementValue(author,"String_Node_Str")});
        }
      }
    }
  }
  if (authors.size() > 0) {
    List<Value> values=new LinkedList<Value>();
    for (    String[] sArray : authors) {
      values.add(new StringValue(sArray[1] + "String_Node_Str" + sArray[0]));
    }
    record.addField("String_Node_Str",values);
  }
  Element journal=XMLUtils.getSingleElement(article,"String_Node_Str");
  if (journal != null) {
    List<Element> jnumbers=XMLUtils.getElementList(journal,"String_Node_Str");
    if (jnumbers != null) {
      for (      Element jnumber : jnumbers) {
        if ("String_Node_Str".equals(jnumber.getAttribute("String_Node_Str"))) {
          String issn=jnumber.getTextContent().trim();
          if (issn != null)           record.addValue("String_Node_Str",new StringValue(issn));
        }
 else {
          String eissn=jnumber.getTextContent().trim();
          if (eissn != null)           record.addValue("String_Node_Str",new StringValue(eissn));
        }
      }
    }
    String journalTitle=XMLUtils.getElementValue(journal,"String_Node_Str");
    if (journalTitle != null)     record.addValue("String_Node_Str",new StringValue(journalTitle));
    Element journalIssueElement=XMLUtils.getSingleElement(journal,"String_Node_Str");
    if (journalIssueElement != null) {
      String volume=XMLUtils.getElementValue(journalIssueElement,"String_Node_Str");
      if (volume != null)       record.addValue("String_Node_Str",new StringValue(volume));
      String issue=XMLUtils.getElementValue(journalIssueElement,"String_Node_Str");
      if (issue != null)       record.addValue("String_Node_Str",new StringValue(issue));
      Element pubDataElement=XMLUtils.getSingleElement(journalIssueElement,"String_Node_Str");
      String year=null;
      if (pubDataElement != null) {
        year=XMLUtils.getElementValue(pubDataElement,"String_Node_Str");
        String mounth=XMLUtils.getElementValue(pubDataElement,"String_Node_Str");
        String day=XMLUtils.getElementValue(pubDataElement,"String_Node_Str");
        if (StringUtils.isNotBlank(mounth) && mounthToNum.containsKey(mounth)) {
          year+="String_Node_Str" + mounthToNum.get(mounth);
          if (StringUtils.isNotBlank(day)) {
            year+="String_Node_Str" + (day.length() == 1 ? "String_Node_Str" + day : day);
          }
        }
      }
      if (year != null)       record.addValue("String_Node_Str",new StringValue(year));
    }
    String language=XMLUtils.getElementValue(article,"String_Node_Str");
    if (language != null)     record.addValue("String_Node_Str",new StringValue(language));
    List<String> type=new LinkedList<String>();
    Element publicationTypeList=XMLUtils.getSingleElement(article,"String_Node_Str");
    if (publicationTypeList != null) {
      List<Element> publicationTypes=XMLUtils.getElementList(publicationTypeList,"String_Node_Str");
      for (      Element publicationType : publicationTypes) {
        type.add(publicationType.getTextContent().trim());
      }
    }
    if (type.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : type) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    List<String> primaryKeywords=new LinkedList<String>();
    List<String> secondaryKeywords=new LinkedList<String>();
    Element keywordsList=XMLUtils.getSingleElement(medline,"String_Node_Str");
    if (keywordsList != null) {
      List<Element> keywords=XMLUtils.getElementList(keywordsList,"String_Node_Str");
      for (      Element keyword : keywords) {
        if ("String_Node_Str".equals(keyword.getAttribute("String_Node_Str"))) {
          primaryKeywords.add(keyword.getTextContent().trim());
        }
 else {
          secondaryKeywords.add(keyword.getTextContent().trim());
        }
      }
    }
    if (primaryKeywords.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : primaryKeywords) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    if (secondaryKeywords.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : secondaryKeywords) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    List<String> primaryMeshHeadings=new LinkedList<String>();
    List<String> secondaryMeshHeadings=new LinkedList<String>();
    Element meshHeadingsList=XMLUtils.getSingleElement(medline,"String_Node_Str");
    if (meshHeadingsList != null) {
      List<Element> meshHeadings=XMLUtils.getElementList(meshHeadingsList,"String_Node_Str");
      for (      Element meshHeading : meshHeadings) {
        if ("String_Node_Str".equals(XMLUtils.getElementAttribute(meshHeading,"String_Node_Str","String_Node_Str"))) {
          primaryMeshHeadings.add(XMLUtils.getElementValue(meshHeading,"String_Node_Str"));
        }
 else {
          secondaryMeshHeadings.add(XMLUtils.getElementValue(meshHeading,"String_Node_Str"));
        }
      }
    }
    if (primaryMeshHeadings.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : primaryMeshHeadings) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    if (secondaryMeshHeadings.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : secondaryMeshHeadings) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    Element paginationElement=XMLUtils.getSingleElement(article,"String_Node_Str");
    if (paginationElement != null) {
      String startPage=XMLUtils.getElementValue(paginationElement,"String_Node_Str");
      String endPage=XMLUtils.getElementValue(paginationElement,"String_Node_Str");
      if (StringUtils.isBlank(startPage)) {
        startPage=XMLUtils.getElementValue(paginationElement,"String_Node_Str");
      }
      if (startPage != null)       record.addValue("String_Node_Str",new StringValue(startPage));
      if (endPage != null)       record.addValue("String_Node_Str",new StringValue(endPage));
    }
  }
  return record;
}

Fixed version (ground truth):
public static Record convertCrossRefDomToRecord(Element pubArticle){
  MutableRecord record=new SubmissionLookupPublication("String_Node_Str");
  Map<String,String> mounthToNum=new HashMap<String,String>();
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  mounthToNum.put("String_Node_Str","String_Node_Str");
  Element medline=XMLUtils.getSingleElement(pubArticle,"String_Node_Str");
  Element article=XMLUtils.getSingleElement(medline,"String_Node_Str");
  Element pubmed=XMLUtils.getSingleElement(pubArticle,"String_Node_Str");
  Element identifierList=XMLUtils.getSingleElement(pubmed,"String_Node_Str");
  if (identifierList != null) {
    List<Element> identifiers=XMLUtils.getElementList(identifierList,"String_Node_Str");
    if (identifiers != null) {
      for (      Element id : identifiers) {
        if ("String_Node_Str".equals(id.getAttribute("String_Node_Str"))) {
          String pubmedID=id.getTextContent().trim();
          if (pubmedID != null)           record.addValue("String_Node_Str",new StringValue(pubmedID));
        }
 else         if ("String_Node_Str".equals(id.getAttribute("String_Node_Str"))) {
          String doi=id.getTextContent().trim();
          if (doi != null)           record.addValue("String_Node_Str",new StringValue(doi));
        }
      }
    }
  }
  String status=XMLUtils.getElementValue(pubmed,"String_Node_Str");
  if (status != null)   record.addValue("String_Node_Str",new StringValue(status));
  String pubblicationModel=XMLUtils.getElementAttribute(medline,"String_Node_Str","String_Node_Str");
  if (pubblicationModel != null)   record.addValue("String_Node_Str",new StringValue(pubblicationModel));
  String title=XMLUtils.getElementValue(article,"String_Node_Str");
  if (title != null)   record.addValue("String_Node_Str",new StringValue(title));
  Element abstractElement=XMLUtils.getSingleElement(article,"String_Node_Str");
  if (abstractElement == null) {
    abstractElement=XMLUtils.getSingleElement(medline,"String_Node_Str");
  }
  if (abstractElement != null) {
    String summary=XMLUtils.getElementValue(abstractElement,"String_Node_Str");
    if (summary != null)     record.addValue("String_Node_Str",new StringValue(summary));
  }
  List<String[]> authors=new LinkedList<String[]>();
  Element authorList=XMLUtils.getSingleElement(article,"String_Node_Str");
  if (authorList != null) {
    List<Element> authorsElement=XMLUtils.getElementList(authorList,"String_Node_Str");
    if (authorsElement != null) {
      for (      Element author : authorsElement) {
        if (StringUtils.isBlank(XMLUtils.getElementValue(author,"String_Node_Str"))) {
          authors.add(new String[]{XMLUtils.getElementValue(author,"String_Node_Str"),XMLUtils.getElementValue(author,"String_Node_Str")});
        }
      }
    }
  }
  if (authors.size() > 0) {
    List<Value> values=new LinkedList<Value>();
    for (    String[] sArray : authors) {
      values.add(new StringValue(sArray[1] + "String_Node_Str" + sArray[0]));
    }
    record.addField("String_Node_Str",values);
  }
  Element journal=XMLUtils.getSingleElement(article,"String_Node_Str");
  if (journal != null) {
    List<Element> jnumbers=XMLUtils.getElementList(journal,"String_Node_Str");
    if (jnumbers != null) {
      for (      Element jnumber : jnumbers) {
        if ("String_Node_Str".equals(jnumber.getAttribute("String_Node_Str"))) {
          String issn=jnumber.getTextContent().trim();
          if (issn != null)           record.addValue("String_Node_Str",new StringValue(issn));
        }
 else {
          String eissn=jnumber.getTextContent().trim();
          if (eissn != null)           record.addValue("String_Node_Str",new StringValue(eissn));
        }
      }
    }
    String journalTitle=XMLUtils.getElementValue(journal,"String_Node_Str");
    if (journalTitle != null)     record.addValue("String_Node_Str",new StringValue(journalTitle));
    Element journalIssueElement=XMLUtils.getSingleElement(journal,"String_Node_Str");
    if (journalIssueElement != null) {
      String volume=XMLUtils.getElementValue(journalIssueElement,"String_Node_Str");
      if (volume != null)       record.addValue("String_Node_Str",new StringValue(volume));
      String issue=XMLUtils.getElementValue(journalIssueElement,"String_Node_Str");
      if (issue != null)       record.addValue("String_Node_Str",new StringValue(issue));
      Element pubDataElement=XMLUtils.getSingleElement(journalIssueElement,"String_Node_Str");
      String year=null;
      if (pubDataElement != null) {
        year=XMLUtils.getElementValue(pubDataElement,"String_Node_Str");
        String mounth=XMLUtils.getElementValue(pubDataElement,"String_Node_Str");
        String day=XMLUtils.getElementValue(pubDataElement,"String_Node_Str");
        if (StringUtils.isNotBlank(mounth) && mounthToNum.containsKey(mounth)) {
          year+="String_Node_Str" + mounthToNum.get(mounth);
          if (StringUtils.isNotBlank(day)) {
            year+="String_Node_Str" + (day.length() == 1 ? "String_Node_Str" + day : day);
          }
        }
      }
      if (year != null)       record.addValue("String_Node_Str",new StringValue(year));
    }
    String language=XMLUtils.getElementValue(article,"String_Node_Str");
    if (language != null)     record.addValue("String_Node_Str",new StringValue(language));
    List<String> type=new LinkedList<String>();
    Element publicationTypeList=XMLUtils.getSingleElement(article,"String_Node_Str");
    if (publicationTypeList != null) {
      List<Element> publicationTypes=XMLUtils.getElementList(publicationTypeList,"String_Node_Str");
      for (      Element publicationType : publicationTypes) {
        type.add(publicationType.getTextContent().trim());
      }
    }
    if (type.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : type) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    List<String> primaryKeywords=new LinkedList<String>();
    List<String> secondaryKeywords=new LinkedList<String>();
    Element keywordsList=XMLUtils.getSingleElement(medline,"String_Node_Str");
    if (keywordsList != null) {
      List<Element> keywords=XMLUtils.getElementList(keywordsList,"String_Node_Str");
      for (      Element keyword : keywords) {
        if ("String_Node_Str".equals(keyword.getAttribute("String_Node_Str"))) {
          primaryKeywords.add(keyword.getTextContent().trim());
        }
 else {
          secondaryKeywords.add(keyword.getTextContent().trim());
        }
      }
    }
    if (primaryKeywords.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : primaryKeywords) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    if (secondaryKeywords.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : secondaryKeywords) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    List<String> primaryMeshHeadings=new LinkedList<String>();
    List<String> secondaryMeshHeadings=new LinkedList<String>();
    Element meshHeadingsList=XMLUtils.getSingleElement(medline,"String_Node_Str");
    if (meshHeadingsList != null) {
      List<Element> meshHeadings=XMLUtils.getElementList(meshHeadingsList,"String_Node_Str");
      for (      Element meshHeading : meshHeadings) {
        if ("String_Node_Str".equals(XMLUtils.getElementAttribute(meshHeading,"String_Node_Str","String_Node_Str"))) {
          primaryMeshHeadings.add(XMLUtils.getElementValue(meshHeading,"String_Node_Str"));
        }
 else {
          secondaryMeshHeadings.add(XMLUtils.getElementValue(meshHeading,"String_Node_Str"));
        }
      }
    }
    if (primaryMeshHeadings.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : primaryMeshHeadings) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    if (secondaryMeshHeadings.size() > 0) {
      List<Value> values=new LinkedList<Value>();
      for (      String s : secondaryMeshHeadings) {
        values.add(new StringValue(s));
      }
      record.addField("String_Node_Str",values);
    }
    Element paginationElement=XMLUtils.getSingleElement(article,"String_Node_Str");
    if (paginationElement != null) {
      String startPage=XMLUtils.getElementValue(paginationElement,"String_Node_Str");
      String endPage=XMLUtils.getElementValue(paginationElement,"String_Node_Str");
      if (StringUtils.isBlank(startPage)) {
        startPage=XMLUtils.getElementValue(paginationElement,"String_Node_Str");
      }
      if (startPage != null)       record.addValue("String_Node_Str",new StringValue(startPage));
      if (endPage != null)       record.addValue("String_Node_Str",new StringValue(endPage));
    }
  }
  return record;
}