nus-yam/ex-repair huggingface dataset:
Program: 44019
Project: 44019
Buggy source:
/** 
 * Visit.
 * @param node traverse and collect node names
 */
public void visit(Node node){
  logger.log(Level.INFO,"String_Node_Str",node);
  this.nameNodeSet.add(node.getNodeName());
  NodeList children=node.getChildNodes();
  if (children != null) {
    int noOfNodes=children.getLength();
    for (int i=0; i < noOfNodes; i++) {
      Node tmpNode=children.item(i);
      this.nameNodeSet.add(tmpNode.getNodeName());
      visit(tmpNode);
    }
  }
}

Fixed version (ground truth):
/** 
 * Visit.
 * @param node traverse and collect node names
 */
public void visit(Node node){
  logger.log(Level.FINEST,"String_Node_Str",node);
  this.nameNodeSet.add(node.getNodeName());
  NodeList children=node.getChildNodes();
  if (children != null) {
    int noOfNodes=children.getLength();
    for (int i=0; i < noOfNodes; i++) {
      Node tmpNode=children.item(i);
      this.nameNodeSet.add(tmpNode.getNodeName());
      visit(tmpNode);
    }
  }
}
Program: 44020
Project: 44020
Buggy source:
/** 
 * Gets the usage hierarchy for field.
 * @param allPossiblePaths the all possible paths
 * @param fieldName the field name
 * @return the possible usage paths to a field.
 */
public static List<String> getUsageHierarchyForField(List<String> allPossiblePaths,String fieldName){
  logger.info("String_Node_Str" + fieldName);
  logger.entering("String_Node_Str","String_Node_Str",fieldName);
  ArrayList<String> paths=new ArrayList<String>();
  for (  String path : allPossiblePaths) {
    if (path.endsWith(fieldName)) {
      paths.add(path.substring(0,path.lastIndexOf("String_Node_Str")));
    }
 else     if (path.contains("String_Node_Str" + fieldName + "String_Node_Str")) {
      paths.add(path.substring(0,path.indexOf("String_Node_Str" + fieldName + "String_Node_Str")));
    }
  }
  logger.exiting("String_Node_Str","String_Node_Str",paths);
  return paths;
}

Fixed version (ground truth):
/** 
 * Gets the usage hierarchy for field.
 * @param allPossiblePaths the all possible paths
 * @param fieldName the field name
 * @return the possible usage paths to a field.
 */
public static List<String> getUsageHierarchyForField(List<String> allPossiblePaths,String fieldName){
  logger.finest("String_Node_Str" + fieldName);
  logger.entering("String_Node_Str","String_Node_Str",fieldName);
  ArrayList<String> paths=new ArrayList<String>();
  for (  String path : allPossiblePaths) {
    if (path.endsWith(fieldName)) {
      paths.add(path.substring(0,path.lastIndexOf("String_Node_Str")));
    }
 else     if (path.contains("String_Node_Str" + fieldName + "String_Node_Str")) {
      paths.add(path.substring(0,path.indexOf("String_Node_Str" + fieldName + "String_Node_Str")));
    }
  }
  logger.exiting("String_Node_Str","String_Node_Str",paths);
  return paths;
}
Program: 44024
Project: 44024
Buggy source:
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  wsdlPath=this.getClass().getClassLoader().getResource("String_Node_Str").toExternalForm();
  Context.getContext().addParser("String_Node_Str",new TestAnnoParserClass());
}

Fixed version (ground truth):
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  wsdlPath=this.getClass().getClassLoader().getResource("String_Node_Str").toExternalForm();
  ConfigurationReader.loadDefaultConfiguration();
  Context.getContext().addParser("String_Node_Str",new TestAnnoParserClass());
}
Program: 44027
Project: 44027
Buggy source:
public synchronized XSDDocInterface parse(String url) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",url);
  XSDDocument xsdDocument=Context.getContext().getNewXsdDocument();
  try {
    URL file=new URL(url);
    Document doc=initialize(file);
    xsdDocument.setDocumentURL(file);
    mergeImportedXsd(doc,xsdDocument,"String_Node_Str");
    if (doc != null) {
      this.visit(doc);
      this.parseAllNSElements(doc,xsdDocument);
      this.parseAllNSComplexTypes(doc,xsdDocument);
      this.linkChildTypes(xsdDocument);
      this.parseAllNSSimpleTypes(doc,xsdDocument);
      this.buildElementToTypeMap(xsdDocument);
      mergeImportedXsd(doc,xsdDocument,"String_Node_Str");
      handleAnonymous(doc,xsdDocument);
    }
  }
 catch (  SAXException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new ParserException("String_Node_Str" + url + "String_Node_Str"+ e.getMessage(),e);
  }
catch (  IOException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new ParserException("String_Node_Str" + url + "String_Node_Str"+ e.getMessage(),e);
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
  postProcessXsdDocument(xsdDocument,doc);
  return xsdDocument;
}

Fixed version (ground truth):
public synchronized XSDDocInterface parse(String url) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",url);
  XSDDocument xsdDocument=Context.getContext().getNewXsdDocument();
  try {
    URL file=new URL(url);
    Document doc=initialize(file);
    xsdDocument.setDocumentURL(file);
    if (doc != null) {
      this.visit(doc);
      this.parseAllNSElements(doc,xsdDocument);
      this.parseAllNSComplexTypes(doc,xsdDocument);
      this.linkChildTypes(xsdDocument);
      this.parseAllNSSimpleTypes(doc,xsdDocument);
      this.buildElementToTypeMap(xsdDocument);
      mergeImportedXsd(doc,xsdDocument,"String_Node_Str");
      mergeImportedXsd(doc,xsdDocument,"String_Node_Str");
      handleAnonymous(doc,xsdDocument);
    }
  }
 catch (  SAXException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new ParserException("String_Node_Str" + url + "String_Node_Str"+ e.getMessage(),e);
  }
catch (  IOException e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new ParserException("String_Node_Str" + url + "String_Node_Str"+ e.getMessage(),e);
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
  postProcessXsdDocument(xsdDocument,doc);
  return xsdDocument;
}
Program: 44029
Project: 44029
Buggy source:
/** 
 * Parses the simple types.
 * @param tagName the tag name
 * @param srcDoc the src doc
 * @param xsdDocument parses SimpleTypes within the document TBD: has to make it generic across namespaces
 * @throws XsdDocException 
 */
private void parseSimpleTypes(Document srcDoc,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{srcDoc,xsdDocument});
  NodeList domElements=srcDoc.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  int noOfDomElements=domElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)domElements.item(i);
    SimpleType sType=populateSimpleType(xsdDocument,obj,false);
    org.w3c.dom.Element parent=(org.w3c.dom.Element)obj.getParentNode();
    if (!parent.getTagName().endsWith("String_Node_Str")) {
      if (Utils.isEmpty(sType.getName())) {
        sType.setName("String_Node_Str" + i);
      }
      xsdDocument.addSimpleType(sType);
    }
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
}

Fixed version (ground truth):
/** 
 * Parses the simple types.
 * @param tagName the tag name
 * @param srcDoc the src doc
 * @param xsdDocument parses SimpleTypes within the document TBD: has to make it generic across namespaces
 * @throws XsdDocException 
 */
private void parseSimpleTypes(Document srcDoc,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{srcDoc,xsdDocument});
  NodeList domElements=srcDoc.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  int noOfDomElements=domElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)domElements.item(i);
    SimpleType sType=populateSimpleType(xsdDocument,obj,false);
    org.w3c.dom.Element parent=(org.w3c.dom.Element)obj.getParentNode();
    if (!parent.getTagName().endsWith("String_Node_Str")) {
      if (Utils.isEmpty(sType.getName())) {
        sType.setName("String_Node_Str" + i);
      }
      if (sType.getEnums() != null) {
        for (        EnumElement enumE : sType.getEnums()) {
          enumE.setType(sType.getName());
          xsdDocument.addEnum(enumE);
        }
      }
      xsdDocument.addSimpleType(sType);
    }
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
}
Program: 44030
Project: 44030
Buggy source:
/** 
 * Parses the enum elements.
 * @param namespacePrefix the namespace prefix
 * @param element the element
 * @param xsdDocument the xsd document
 * @return collection of enums contained by an element associates enums toits annotations
 * @throws ParserException 
 */
private List<EnumElement> parseEnumElements(org.w3c.dom.Element element,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{element,xsdDocument});
  List<EnumElement> elements=new ArrayList<EnumElement>();
  NodeList domElements=element.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  int noOfDomElements=domElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)domElements.item(i);
    String value=obj.getAttribute("String_Node_Str");
    EnumElement elem=Context.getContext().getNewEnumeration();
    elem.setValue(value);
    elem.setType(element.getAttribute("String_Node_Str"));
    elem.setAnnotations(parseAnnotation(obj));
    elements.add(elem);
    postProcessEnum(elem,obj);
    xsdDocument.addEnum(elem);
  }
  logger.log(Level.FINER,"String_Node_Str",elements);
  return elements;
}

Fixed version (ground truth):
/** 
 * Parses the enum elements.
 * @param namespacePrefix the namespace prefix
 * @param element the element
 * @param xsdDocument the xsd document
 * @return collection of enums contained by an element associates enums toits annotations
 * @throws ParserException 
 */
private List<EnumElement> parseEnumElements(org.w3c.dom.Element element,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{element,xsdDocument});
  List<EnumElement> elements=new ArrayList<EnumElement>();
  NodeList domElements=element.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  int noOfDomElements=domElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)domElements.item(i);
    String value=obj.getAttribute("String_Node_Str");
    EnumElement elem=Context.getContext().getNewEnumeration();
    elem.setValue(value);
    elem.setType(element.getAttribute("String_Node_Str"));
    elem.setAnnotations(parseAnnotation(obj));
    elements.add(elem);
    postProcessEnum(elem,obj);
  }
  logger.log(Level.FINER,"String_Node_Str",elements);
  return elements;
}
Program: 44032
Project: 44032
Buggy source:
/** 
 * Gets the annotation info.
 * @return handle to ParsedAnnotationInfo object whichis the parsed annotation data including documentation and appInfo
 */
public ParsedAnnotationInfo getAnnotationInfo(){
  return annotation;
}

Fixed version (ground truth):
/** 
 * Gets the annotation info.
 * @return handle to ParsedAnnotationInfo object which is the parsedannotation data including documentation and appInfo
 */
public ParsedAnnotationInfo getAnnotationInfo(){
  return annotation;
}
Program: 44033
Project: 44033
Buggy source:
public int compareTo(Element object){
  return this.getName().toUpperCase().compareTo(object.getName().toUpperCase());
}

Fixed version (ground truth):
public int compareTo(Element object){
  int retVal=this.getName().toUpperCase().compareTo(object.getName().toUpperCase());
  if (retVal == 0 && (this.getType().equals(object.getType()) && ((this.getContainerComplexType() != null && this.getContainerComplexType().equals(object.getContainerComplexType())) || (object.getContainerComplexType() == null && this.getContainerComplexType() == null)))) {
    return 0;
  }
 else {
    if (retVal == 0) {
      retVal=1;
    }
    return retVal;
  }
}
Program: 44035
Project: 44035
Buggy source:
/** 
 * Parses the complex types.
 * @param tagName the tag name
 * @param srcDoc dom handle
 * @param xsdDocument handle parses the complex types, its annotations and populates the xsd
 * @throws XsdDocException 
 */
private void parseComplexTypes(Document srcDoc,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{srcDoc,xsdDocument});
  NodeList ctypeElements=srcDoc.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  this.setCtypes(ctypeElements);
  int noOfDomElements=ctypeElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)ctypeElements.item(i);
    String name=obj.getAttribute("String_Node_Str");
    ComplexType cType=Context.getContext().getNewComplexType();
    cType.setName(name);
    cType.setAnnotationInfo(parseAnnotation(obj));
    NamedNodeMap nameNodeMap=obj.getAttributes();
    int size=nameNodeMap.getLength();
    for (int j=0; j < size; j++) {
      Attr attr=(Attr)nameNodeMap.item(j);
      if (attr != null) {
        Attribute attribute=new Attribute();
        attribute.setName(attr.getName());
        attribute.setValue(attr.getValue());
        cType.getAttributes().add(attribute);
      }
    }
    cType.setChildElements(this.parseChildElements(cType,ctypeElements,obj,xsdDocument));
    List<Element> instances=(List<Element>)typeElementsMap.get(name);
    if (instances != null) {
      cType.setInstanceElements(instances);
    }
    postProcessComplexType(cType,obj);
    xsdDocument.addComplexType(cType);
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
}

Fixed version (ground truth):
/** 
 * Parses the complex types.
 * @param tagName the tag name
 * @param srcDoc dom handle
 * @param xsdDocument handle parses the complex types, its annotations and populates the xsd
 * @throws XsdDocException 
 */
private void parseComplexTypes(Document srcDoc,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{srcDoc,xsdDocument});
  NodeList ctypeElements=srcDoc.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  this.setCtypes(ctypeElements);
  int noOfDomElements=ctypeElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)ctypeElements.item(i);
    xsdDocument.addComplexType(processComplexType(xsdDocument,obj));
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
}
Program: 44038
Project: 44038
Buggy source:
private SimpleType populateSimpleType(XSDDocument xsdDocument,org.w3c.dom.Element obj,boolean fromAttribute) throws ParserException {
  NodeList nodes=obj.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  String base=((org.w3c.dom.Element)nodes.item(0)).getAttribute("String_Node_Str");
  String name=obj.getAttribute("String_Node_Str");
  SimpleType sType=Context.getContext().getNewSimpleType();
  sType.setBase(base);
  sType.setName(name);
  List<Element> instances=(List<Element>)typeElementsMap.get(name);
  NamedNodeMap nameNodeMap=obj.getAttributes();
  int size=nameNodeMap.getLength();
  for (int j=0; j < size; j++) {
    Attr attr=(Attr)nameNodeMap.item(j);
    if (attr != null) {
      Attribute attribute=new Attribute();
      attribute.setName(attr.getName());
      attribute.setValue(attr.getValue());
      sType.getAttributes().add(attribute);
    }
  }
  sType.setAnnotationInfo(parseAnnotation(obj));
  sType.setEnums(this.parseEnumElements(obj,xsdDocument));
  if (instances != null) {
    sType.setInstanceElements(instances);
  }
  if (!fromAttribute) {
    org.w3c.dom.Element parent=(org.w3c.dom.Element)obj.getParentNode();
    if (!parent.getTagName().endsWith("String_Node_Str")) {
      xsdDocument.addSimpleType(sType);
    }
  }
 else {
    xsdDocument.addSimpleType(sType);
  }
  postProcessSimpleType(sType,obj);
  return sType;
}

Fixed version (ground truth):
private SimpleType populateSimpleType(XSDDocument xsdDocument,org.w3c.dom.Element obj,boolean fromAttribute) throws ParserException {
  NodeList nodes=obj.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  String base=((org.w3c.dom.Element)nodes.item(0)).getAttribute("String_Node_Str");
  String name=obj.getAttribute("String_Node_Str");
  SimpleType sType=Context.getContext().getNewSimpleType();
  sType.setBase(base);
  sType.setName(name);
  List<Element> instances=(List<Element>)typeElementsMap.get(name);
  NamedNodeMap nameNodeMap=obj.getAttributes();
  int size=nameNodeMap.getLength();
  for (int j=0; j < size; j++) {
    Attr attr=(Attr)nameNodeMap.item(j);
    if (attr != null) {
      Attribute attribute=new Attribute();
      attribute.setName(attr.getName());
      attribute.setValue(attr.getValue());
      sType.getAttributes().add(attribute);
    }
  }
  sType.setAnnotationInfo(parseAnnotation(obj));
  sType.setEnums(this.parseEnumElements(obj,xsdDocument));
  if (instances != null) {
    sType.setInstanceElements(instances);
  }
  postProcessSimpleType(sType,obj);
  return sType;
}
Program: 44039
Project: 44039
Buggy source:
/** 
 * Parses the simple types.
 * @param tagName the tag name
 * @param srcDoc the src doc
 * @param xsdDocument parses SimpleTypes within the document TBD: has to make it generic across namespaces
 * @throws XsdDocException 
 */
private void parseSimpleTypes(Document srcDoc,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{srcDoc,xsdDocument});
  NodeList domElements=srcDoc.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  int noOfDomElements=domElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)domElements.item(i);
    populateSimpleType(xsdDocument,obj,false);
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
}

Fixed version (ground truth):
/** 
 * Parses the simple types.
 * @param tagName the tag name
 * @param srcDoc the src doc
 * @param xsdDocument parses SimpleTypes within the document TBD: has to make it generic across namespaces
 * @throws XsdDocException 
 */
private void parseSimpleTypes(Document srcDoc,XSDDocument xsdDocument) throws ParserException {
  logger.log(Level.FINER,"String_Node_Str",new Object[]{srcDoc,xsdDocument});
  NodeList domElements=srcDoc.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  int noOfDomElements=domElements.getLength();
  for (int i=0; i < noOfDomElements; i++) {
    org.w3c.dom.Element obj=(org.w3c.dom.Element)domElements.item(i);
    SimpleType sType=populateSimpleType(xsdDocument,obj,false);
    org.w3c.dom.Element parent=(org.w3c.dom.Element)obj.getParentNode();
    if (!parent.getTagName().endsWith("String_Node_Str")) {
      if (Utils.isEmpty(sType.getName())) {
        sType.setName("String_Node_Str" + i);
      }
      xsdDocument.addSimpleType(sType);
    }
  }
  logger.log(Level.FINER,"String_Node_Str",xsdDocument);
}
Program: 44040
Project: 44040
Buggy source:
/** 
 * Convert to url. The path supplied is first tried as a URL external form string, if it fails it is tried as a Class path resource, Then it is tried as a local file path.
 * @param path the path 
 * @return the uRL
 */
public static URL convertToURL(String path){
  URL url=null;
  try {
    url=new URL(path);
  }
 catch (  MalformedURLException e) {
    url=Thread.currentThread().getContextClassLoader().getResource(path);
    if (url == null) {
      File file=new File(path);
      if (file.exists()) {
        try {
          url=file.toURI().toURL();
        }
 catch (        MalformedURLException e1) {
          Logger.getLogger(ConfigurationReader.class.getName()).log(Level.SEVERE,path + "String_Node_Str",e);
          throw new ConfigurationException("String_Node_Str" + path + "String_Node_Str"+ path+ "String_Node_Str",e);
        }
      }
    }
  }
  return url;
}

Fixed version (ground truth):
/** 
 * Convert to url. The path supplied is first tried as a URL external form string, if it fails it is tried as a Class path resource, Then it is tried as a local file path.
 * @param path the path 
 * @return the uRL
 */
public static URL convertToURL(String path){
  URL url=null;
  try {
    url=new URL(path);
  }
 catch (  MalformedURLException e) {
    url=Thread.currentThread().getContextClassLoader().getResource(path);
    if (url == null) {
      File file=new File(path);
      if (file.exists()) {
        try {
          url=file.toURI().toURL();
        }
 catch (        MalformedURLException e1) {
          Logger.getLogger(ConfigurationReader.class.getName()).log(Level.SEVERE,path + "String_Node_Str",e);
          throw new ConfigurationException("String_Node_Str" + path + "String_Node_Str"+ path+ "String_Node_Str",e);
        }
      }
    }
  }
  if (url == null) {
    throw new ConfigurationException("String_Node_Str" + path + "String_Node_Str"+ path+ "String_Node_Str");
  }
  return url;
}
Program: 44041
Project: 44041
Buggy source:
/** 
 * Adds the simple attribute content.
 * @param simpleAttributeContent the simple attribute content
 */
public void addSimpleAttributeContent(AttributeElement simpleAttributeContent){
  if (this.simpleAttributeContent == null) {
    this.simpleAttributeContent=new TreeSet<AttributeElement>();
  }
  this.simpleAttributeContent.add(simpleAttributeContent);
}

Fixed version (ground truth):
/** 
 * Adds the simple attribute content.
 * @param simpleAttributeContent the simple attribute content
 */
public void addSimpleAttributeContent(AttributeElement simpleAttributeContent){
  if (this.simpleAttributeContent == null) {
    this.simpleAttributeContent=new LinkedHashSet<AttributeElement>();
  }
  this.simpleAttributeContent.add(simpleAttributeContent);
}
Program: 44042
Project: 44042
Buggy source:
/** 
 * Gets the next sibling ignoring empty white-space nodes.
 * @param node the node
 * @return the next sibling
 */
private Node getNextSibling(Node node){
  Node sib=node.getNextSibling();
  if (sib != null && sib.getNodeType() == Node.TEXT_NODE) {
    String value=sib.getTextContent();
    if (value != null) {
      value=value.replaceAll("String_Node_Str","String_Node_Str");
      value=value.replaceAll("String_Node_Str","String_Node_Str");
      value=value.replaceAll("String_Node_Str","String_Node_Str");
      if (Utils.isEmpty(value)) {
        sib=getNextSibling(sib);
      }
    }
  }
  logger.log(Level.INFO,"String_Node_Str",sib);
  return sib;
}

Fixed version (ground truth):
/** 
 * Gets the next sibling ignoring empty white-space nodes.
 * @param node the node
 * @return the next sibling
 */
private Node getNextSibling(Node node){
  Node sib=node.getNextSibling();
  if (sib != null && Node.COMMENT_NODE == sib.getNodeType()) {
    sib=getNextSibling(sib);
  }
  if (sib != null && sib.getNodeType() == Node.TEXT_NODE) {
    String value=sib.getTextContent();
    if (value != null) {
      value=value.replaceAll("String_Node_Str","String_Node_Str");
      value=value.replaceAll("String_Node_Str","String_Node_Str");
      value=value.replaceAll("String_Node_Str","String_Node_Str");
      if (Utils.isEmpty(value)) {
        sib=getNextSibling(sib);
      }
    }
  }
  logger.log(Level.INFO,"String_Node_Str",sib);
  return sib;
}
Program: 44044
Project: 44044
Buggy source:
/** 
 * Adds the footer.
 * @param html the html
 * @throws OutputFormatterException
 */
private void addFooter(StringBuffer html,boolean isType,boolean isComplexType,String typeName,String relPath,boolean isIndex,String keyLinks) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",html);
  String content=getFooterInformation(isType,isComplexType,typeName,relPath,isIndex,keyLinks);
  html.append(getTextInDiv(content,"String_Node_Str"));
  html.append(HtmlUtils.getEndTags());
  logger.exiting("String_Node_Str","String_Node_Str",html);
}

Fixed version (ground truth):
/** 
 * Adds the footer.
 * @param html the html
 * @throws OutputFormatterException
 */
private void addFooter(StringBuffer html,Map<String,String> replacementMap,String hdrFileParameterName) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",html);
  String content=getFooterInformation(replacementMap,hdrFileParameterName);
  html.append(getTextInDiv(content,"String_Node_Str"));
  html.append(HtmlUtils.getEndTags());
  logger.exiting("String_Node_Str","String_Node_Str",html);
}
Program: 44045
Project: 44045
Buggy source:
/** 
 * Gets the footer information. This method can be over ridden to supply Footer.
 * @return the footer information
 * @throws OutputFormatterException
 */
protected String getFooterInformation(boolean isType,boolean isComplex,String typeName,String relPath,boolean isIndex,String keyLinks) throws OutputFormatterException {
  String parameterName=getHeaderFileName(isType,isComplex,isIndex);
  String headerFile=outputGenaratorParam.getParameters().get(parameterName);
  if (headerFile != null) {
    try {
      String header=Utils.getFileAsString(Utils.convertToURL(headerFile).openStream()).toString();
      String version=outputGenaratorParam.getParameters().get("String_Node_Str");
      header=header.replaceAll("String_Node_Str",version);
      header=header.replaceAll("String_Node_Str",typeName);
      header=header.replaceAll("String_Node_Str",relPath);
      if (isIndex) {
        if (keyLinks == null) {
          keyLinks="String_Node_Str";
        }
        header=header.replaceAll("String_Node_Str",keyLinks);
      }
      header="String_Node_Str" + header;
      return header;
    }
 catch (    IOException e) {
      throw new OutputFormatterException(e);
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Gets the footer information. This method can be over ridden to supply Footer.
 * @return the footer information
 * @throws OutputFormatterException
 */
protected String getFooterInformation(Map<String,String> replacementMap,String hdrFileParameterName) throws OutputFormatterException {
  String headerFile=outputGenaratorParam.getParameters().get(hdrFileParameterName);
  if (headerFile != null) {
    try {
      String header=Utils.getFileAsString(Utils.convertToURL(headerFile).openStream()).toString();
      for (      Map.Entry<String,String> entry : replacementMap.entrySet()) {
        header=header.replaceAll("String_Node_Str" + entry.getKey() + "String_Node_Str",entry.getValue());
      }
      String version=outputGenaratorParam.getParameters().get("String_Node_Str");
      header=header.replaceAll("String_Node_Str",version);
      header="String_Node_Str" + header;
      return header;
    }
 catch (    IOException e) {
      throw new OutputFormatterException(e);
    }
  }
  return "String_Node_Str";
}
Program: 44048
Project: 44048
Buggy source:
/** 
 * Creates the all packages description file.
 * @throws OutputFormatterException
 */
private void createAllPackagesDescriptionFile() throws OutputFormatterException {
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  buildHeader(html,false,false,null,"String_Node_Str",true,null);
  html.append(getTextInDiv("String_Node_Str","String_Node_Str"));
  html.append(Constants.HTML_BR);
  addFooter(html,false,false,null,"String_Node_Str",true,null);
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.INDEX + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the all packages description file.
 * @throws OutputFormatterException
 */
private void createAllPackagesDescriptionFile() throws OutputFormatterException {
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  Map<String,String> replacementMap=new HashMap<String,String>();
  replacementMap.put("String_Node_Str","String_Node_Str");
  replacementMap.put("String_Node_Str","String_Node_Str");
  replacementMap.put("String_Node_Str","String_Node_Str");
  buildHeader(html,replacementMap,"String_Node_Str");
  html.append(getTextInDiv("String_Node_Str","String_Node_Str"));
  html.append(Constants.HTML_BR);
  addFooter(html,replacementMap,"String_Node_Str");
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.INDEX + Constants.DOT_HTML);
}
Program: 44049
Project: 44049
Buggy source:
private void writePackageTree(List<XSDDocInterface> wsdlDoc,String outputdir,boolean isAllPackages,String packageName) throws OutputFormatterException {
  Node root=getTypesInTree(wsdlDoc);
  StringBuffer html=new StringBuffer();
  html.append(Constants.HTML_H3_START + "String_Node_Str" + currentPackageName+ Constants.HTML_H3_END);
  if (!isAllPackages) {
    html.append("String_Node_Str" + Constants.HTML_BR);
    String str="String_Node_Str";
    while (packageName.indexOf('/') != -1) {
      str="String_Node_Str";
      packageName=packageName.substring(packageName.indexOf('/') + 1);
    }
    html.append(Constants.NBSP_THRICE + Constants.NBSP_THRICE + HtmlUtils.getAnchorTag(null,str + "String_Node_Str" + Constants.DOT_HTML,null,"String_Node_Str"));
  }
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + Constants.HTML_H3_END);
  html.append("String_Node_Str");
  writeTree(root,html,isAllPackages);
  html.append("String_Node_Str");
  writeFile(html,outputdir,"String_Node_Str" + Constants.DOT_HTML);
}

Fixed version (ground truth):
private void writePackageTree(List<XSDDocInterface> wsdlDoc,String outputdir,boolean isAllPackages) throws OutputFormatterException {
  Node root=getTypesInTree(wsdlDoc);
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags("String_Node_Str" + currentPackageName,outputdir));
  Map<String,String> replacementMap=new HashMap<String,String>();
  replacementMap.put("String_Node_Str",(outputdir == null ? "String_Node_Str" : getRelativePath(outputdir)));
  replacementMap.put("String_Node_Str","String_Node_Str");
  buildHeader(html,replacementMap,"String_Node_Str");
  html.append(Constants.HTML_H3_START + "String_Node_Str" + currentPackageName+ Constants.HTML_H3_END);
  if (!isAllPackages) {
    html.append("String_Node_Str" + Constants.HTML_BR);
    String str=getRelativePath(outputdir);
    html.append(Constants.NBSP_THRICE + Constants.NBSP_THRICE + HtmlUtils.getAnchorTag(null,str + "String_Node_Str" + Constants.DOT_HTML,null,"String_Node_Str"));
  }
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + Constants.HTML_H3_END);
  html.append("String_Node_Str");
  writeTree(root,html,isAllPackages);
  html.append("String_Node_Str");
  addFooter(html,replacementMap,"String_Node_Str");
  html.append(HtmlUtils.getEndTags());
  if (outputdir == null) {
    outputdir="String_Node_Str";
  }
  writeFile(html,getCurrentOutputDir() + outputdir,"String_Node_Str" + Constants.DOT_HTML);
}
Program: 44050
Project: 44050
Buggy source:
/** 
 * Sets the input types.
 * @param html the html
 * @param opH the op h
 * @param serviceName the service name
 */
private String setInputTypes(StringBuffer html,OperationHolder opH,String serviceName,String locBase){
  logger.entering("String_Node_Str","String_Node_Str",new Object[]{html,opH});
  String params="String_Node_Str";
  List<Element> inputs=opH.getInputTypes();
  if (inputs != null) {
    Iterator<Element> iter=inputs.iterator();
    while (iter.hasNext()) {
      Element elem=iter.next();
      params=HtmlUtils.getAnchorTag(null,locBase + "String_Node_Str" + SEPARATOR+ elem.getType()+ Constants.DOT_HTML,elem.getType(),elem.getType());
      params+="String_Node_Str" + elem.getName();
      if (iter.hasNext()) {
        params+="String_Node_Str";
      }
    }
  }
  html.append(params);
  logger.exiting("String_Node_Str","String_Node_Str",html);
  return params;
}

Fixed version (ground truth):
/** 
 * Sets the input types.
 * @param html the html
 * @param opH the op h
 * @param wsdlDoc the wsdl doc
 * @throws OutputFormatterException
 */
private void setInputTypes(StringBuffer html,OperationHolder opH,WSDLDocInterface wsdlDoc) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",new Object[]{html,opH});
  List<Element> inputs=opH.getInputTypes();
  if (inputs != null) {
    Iterator<Element> iter=inputs.iterator();
    while (iter.hasNext()) {
      Element elem=iter.next();
      html.append(getTextInSpan(HtmlUtils.getAnchorTag(null,"String_Node_Str" + SEPARATOR + elem.getType()+ Constants.DOT_HTML,elem.getType(),elem.getType()),"String_Node_Str"));
      html.append("String_Node_Str");
      html.append(getTextInSpan(elem.getName(),"String_Node_Str"));
      if (iter.hasNext()) {
        html.append("String_Node_Str");
      }
      ComplexType cType=wsdlDoc.searchCType(elem.getType());
      if (cType != null) {
        writeComplexTypeFile(wsdlDoc,cType,cType.getName());
      }
    }
  }
  logger.exiting("String_Node_Str","String_Node_Str",html);
}
Program: 44051
Project: 44051
Buggy source:
/** 
 * Builds the header.
 * @param html the html
 * @throws OutputFormatterException
 */
private void buildHeader(StringBuffer html,boolean isType,boolean isComplex,String typeName,String relPath,boolean isIndex,String keyLinks) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",html);
  String header=getFooterInformation(isType,isComplex,typeName,relPath,isIndex,keyLinks);
  html.append(header);
  logger.exiting("String_Node_Str","String_Node_Str",html);
}

Fixed version (ground truth):
/** 
 * Builds the header.
 * @param html the html
 * @throws OutputFormatterException
 */
private void buildHeader(StringBuffer html,Map<String,String> replacementMap,String hdrFileParameterName) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",html);
  String header=getFooterInformation(replacementMap,hdrFileParameterName);
  html.append(header);
  logger.exiting("String_Node_Str","String_Node_Str",html);
}
Program: 44056
Project: 44056
Buggy source:
public void createTreeFiles() throws OutputFormatterException {
  List<XSDDocInterface> allPackages=new ArrayList<XSDDocInterface>();
  for (  Map.Entry<String,List<XSDDocInterface>> entry : packageDocMap.entrySet()) {
    currentPackageName=entry.getKey();
    List<XSDDocInterface> list=entry.getValue();
    for (    XSDDocInterface xsd : list) {
      List<ComplexType> cTypes=xsd.getAllComplexTypes();
      for (      ComplexType cType : cTypes) {
        cType.setPackageName(((WSDLDocInterface)xsd).getPackageName());
      }
    }
    writePackageTree(list,getCurrentOutputDir() + File.separator + currentPackageName,false,currentPackageName);
    allPackages.addAll(entry.getValue());
  }
  writePackageTree(allPackages,getCurrentOutputDir(),true,null);
}

Fixed version (ground truth):
public void createTreeFiles() throws OutputFormatterException {
  List<XSDDocInterface> allPackages=new ArrayList<XSDDocInterface>();
  for (  Map.Entry<String,List<XSDDocInterface>> entry : packageDocMap.entrySet()) {
    currentPackageName=entry.getKey();
    List<XSDDocInterface> list=entry.getValue();
    for (    XSDDocInterface xsd : list) {
      List<ComplexType> cTypes=xsd.getAllComplexTypes();
      for (      ComplexType cType : cTypes) {
        cType.setPackageName(((WSDLDocInterface)xsd).getPackageName());
      }
    }
    writePackageTree(list,currentPackageName,false);
    allPackages.addAll(entry.getValue());
  }
  writePackageTree(allPackages,null,true);
}
Program: 44058
Project: 44058
Buggy source:
public ComplexType searchCType(String name){
  if (xsdDocument != null) {
    return this.xsdDocument.searchCType(name);
  }
  return xsdDocument.searchCType(name);
}

Fixed version (ground truth):
public ComplexType searchCType(String name){
  if (xsdDocument != null) {
    return this.xsdDocument.searchCType(name);
  }
  return null;
}
Program: 44059
Project: 44059
Buggy source:
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  this.xsdPath=this.getClass().getClassLoader().getResource("String_Node_Str").toExternalForm();
  Context.getContext().addParser("String_Node_Str",new TestAnnoParserClass());
}

Fixed version (ground truth):
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  this.xsdPath=this.getClass().getClassLoader().getResource("String_Node_Str").toExternalForm();
  ConfigurationReader.loadDefaultConfiguration();
  Context.getContext().addParser("String_Node_Str",new TestAnnoParserClass());
}
Program: 44062
Project: 44062
Buggy source:
/** 
 * Parses the annotation.
 * @param namespacePrefix the namespace prefix
 * @param elem the elem
 * @return parses annotation dom element and populates its POJOrepresentation ParsedAnnotationInfo
 */
private ParsedAnnotationInfo parseAnnotation(org.w3c.dom.Element node){
  logger.log(Level.FINER,"String_Node_Str",node);
  ParsedAnnotationInfo info=null;
  if (node != null) {
    info=new ParsedAnnotationInfo();
    String documentation="String_Node_Str";
    for (Node childNode=node.getFirstChild(); childNode != null; ) {
      Node nextChild=childNode.getNextSibling();
      if (childNode.getNodeType() == Node.ELEMENT_NODE) {
        String tagName=childNode.getNodeName();
        AnnotationParser parser=getAnnotationParser(tagName);
        if (parser != null) {
          ParsedAnnotationTag parsedData=parser.parseAnnotation((org.w3c.dom.Element)childNode);
          info.addParsedAnnotationTag(tagName,parsedData);
        }
      }
 else       if (childNode.getNodeType() == Node.TEXT_NODE) {
        documentation=documentation + childNode.getNodeValue();
      }
      childNode=nextChild;
    }
    if (!Utils.isEmpty(documentation)) {
      info.setDocumentation(documentation);
    }
  }
  logger.log(Level.FINER,"String_Node_Str",info);
  return info;
}

Fixed version (ground truth):
/** 
 * Parses the annotation.
 * @param namespacePrefix the namespace prefix
 * @param elem the elem
 * @return parses annotation dom element and populates its POJOrepresentation ParsedAnnotationInfo
 */
private ParsedAnnotationInfo parseAnnotation(org.w3c.dom.Element node){
  logger.log(Level.FINER,"String_Node_Str",node);
  ParsedAnnotationInfo info=null;
  if (node != null) {
    info=new ParsedAnnotationInfo();
    processDocumentation(node,info);
  }
  logger.log(Level.FINER,"String_Node_Str",info);
  return info;
}
Program: 44063
Project: 44063
Buggy source:
/** 
 * Parses the annotation.
 * @param namespacePrefix the namespace prefix
 * @param elem the elem
 * @return parses annotation dom element and populates its POJOrepresentation ParsedAnnotationInfo
 */
private ParsedAnnotationInfo parseAnnotation(org.w3c.dom.Element elem){
  logger.log(Level.FINER,"String_Node_Str",elem);
  NodeList docElementList=(NodeList)elem.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  org.w3c.dom.Element docElement=(org.w3c.dom.Element)docElementList.item(0);
  ParsedAnnotationInfo info=new ParsedAnnotationInfo();
  if (docElement != null) {
    String documentation=docElement.getTextContent();
    info.setDocumentation(documentation);
  }
  NodeList annoElementList=(NodeList)elem.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  org.w3c.dom.Element node=(org.w3c.dom.Element)annoElementList.item(0);
  if (node != null) {
    for (Node childNode=node.getFirstChild(); childNode != null; ) {
      Node nextChild=childNode.getNextSibling();
      if (childNode.getNodeType() == Node.ELEMENT_NODE) {
        String tagName=childNode.getNodeName();
        AnnotationParser parser=getAnnotationParser(tagName);
        if (parser != null) {
          ParsedAnnotationTag parsedData=parser.parseAnnotation((org.w3c.dom.Element)childNode);
          info.addParsedAnnotationTag(tagName,parsedData);
        }
      }
      childNode=nextChild;
    }
  }
  logger.log(Level.FINER,"String_Node_Str",info);
  return info;
}

Fixed version (ground truth):
/** 
 * Parses the annotation.
 * @param namespacePrefix the namespace prefix
 * @param elem the elem
 * @return parses annotation dom element and populates its POJOrepresentation ParsedAnnotationInfo
 */
private ParsedAnnotationInfo parseAnnotation(org.w3c.dom.Element elem){
  logger.log(Level.FINER,"String_Node_Str",elem);
  NodeList docElementList=(NodeList)elem.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  org.w3c.dom.Element docElement=(org.w3c.dom.Element)docElementList.item(0);
  ParsedAnnotationInfo info=new ParsedAnnotationInfo();
  if (docElement != null) {
    processDocumentation(docElement,info);
  }
  NodeList annoElementList=(NodeList)elem.getElementsByTagNameNS("String_Node_Str","String_Node_Str");
  org.w3c.dom.Element node=(org.w3c.dom.Element)annoElementList.item(0);
  if (node != null) {
    for (Node childNode=node.getFirstChild(); childNode != null; ) {
      Node nextChild=childNode.getNextSibling();
      if (childNode.getNodeType() == Node.ELEMENT_NODE) {
        String tagName=childNode.getNodeName();
        AnnotationParser parser=getAnnotationParser(tagName);
        if (parser != null) {
          ParsedAnnotationTag parsedData=parser.parseAnnotation((org.w3c.dom.Element)childNode);
          info.addParsedAnnotationTag(tagName,parsedData);
        }
      }
      childNode=nextChild;
    }
  }
  logger.log(Level.FINER,"String_Node_Str",info);
  return info;
}
Program: 44065
Project: 44065
Buggy source:
private Node getTypesInTree(List<XSDDocInterface> wsdlDoc){
  List<ComplexType> complexTypes=new ArrayList<ComplexType>();
  for (  XSDDocInterface xsdDocument : wsdlDoc) {
    if (xsdDocument.getAllComplexTypes() != null) {
      complexTypes.addAll(xsdDocument.getAllComplexTypes());
    }
  }
  Node root=new Node();
  root.setName("String_Node_Str");
  root.setLevel(0);
  for (  ComplexType type : complexTypes) {
    Node node=new Node();
    node.setName(type.getPackageName() + "String_Node_Str" + type.getName());
    node.setOriginalParent(type.getPackageName() + "String_Node_Str" + type.getParentType());
    getParent(root,node,type.getPackageName() + "String_Node_Str" + type.getParentType());
    if (!node.isNodeAdded()) {
      if (root.getChildren() == null) {
        root.setChildren(new TreeSet<Node>());
      }
      node.setParent(root);
      node.setLevel(root.getLevel() + 1);
      root.getChildren().add(node);
    }
    normalizeTree(type,root,node);
  }
  return root;
}

Fixed version (ground truth):
private Node getTypesInTree(List<XSDDocInterface> wsdlDoc){
  List<ComplexType> complexTypes=new ArrayList<ComplexType>();
  for (  XSDDocInterface xsdDocument : wsdlDoc) {
    if (xsdDocument.getAllComplexTypes() != null) {
      complexTypes.addAll(xsdDocument.getAllComplexTypes());
    }
  }
  Node root=new Node();
  root.setName("String_Node_Str");
  root.setLevel(0);
  for (  ComplexType type : complexTypes) {
    Node node=new Node();
    String packageName=type.getPackageName();
    if (packageName == null) {
      packageName="String_Node_Str";
    }
    node.setName(packageName + "String_Node_Str" + type.getName());
    node.setOriginalParent(packageName + "String_Node_Str" + type.getParentType());
    getParent(root,node,packageName + "String_Node_Str" + type.getParentType());
    if (!node.isNodeAdded()) {
      if (root.getChildren() == null) {
        root.setChildren(new TreeSet<Node>());
      }
      node.setParent(root);
      node.setLevel(root.getLevel() + 1);
      root.getChildren().add(node);
    }
    normalizeTree(type,root,node);
  }
  return root;
}
Program: 44066
Project: 44066
Buggy source:
/** 
 * Creates the all classes file.
 * @throws OutputFormatterException
 */
private void createAllClassesFile() throws OutputFormatterException {
  Set<String> set=packageServicesMap.keySet();
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(Constants.HTML_BOLD_START + Constants.ALL_CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,packageName + SEPARATOR + className+ Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.ALLCLASSES + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the all classes file.
 * @throws OutputFormatterException
 */
private void createAllClassesFile() throws OutputFormatterException {
  Set<String> set=packageServicesMap.keySet();
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(Constants.HTML_BOLD_START + Constants.ALL_CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    if (packageName.startsWith("String_Node_Str")) {
      packageName=packageName.substring(1);
    }
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,packageName + SEPARATOR + className+ Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.ALLCLASSES + Constants.DOT_HTML);
}
Program: 44068
Project: 44068
Buggy source:
private void writePackageTree(WSDLDocInterface wsdlDoc) throws OutputFormatterException {
  Node root=getTypesInTree(wsdlDoc);
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str"));
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + wsdlDoc.getPackageName()+ Constants.HTML_H3_END);
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + Constants.HTML_H3_END);
  html.append("String_Node_Str");
  writeTree(root,html,wsdlDoc.getPackageName());
  html.append("String_Node_Str");
  writeFile(html,getCurrentOutputDir(),"String_Node_Str" + Constants.DOT_HTML);
  System.out.println(root);
}

Fixed version (ground truth):
private void writePackageTree(WSDLDocInterface wsdlDoc) throws OutputFormatterException {
  Node root=getTypesInTree(wsdlDoc);
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str"));
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + wsdlDoc.getPackageName()+ Constants.HTML_H3_END);
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + Constants.HTML_H3_END);
  html.append("String_Node_Str");
  writeTree(root,html);
  html.append("String_Node_Str");
  writeFile(html,getCurrentOutputDir(),"String_Node_Str" + Constants.DOT_HTML);
  System.out.println(root);
}
Program: 44069
Project: 44069
Buggy source:
private void writeTree(Node root,StringBuffer html,String packageName){
  Set<Node> children=root.getChildren();
  if (children != null) {
    html.append("String_Node_Str");
    for (    Node node : children) {
      if (node.isFlag()) {
        html.append("String_Node_Str");
        html.append(HtmlUtils.getAnchorTag("String_Node_Str","String_Node_Str" + packageName + "String_Node_Str"+ node.getName()+ Constants.DOT_HTML,"String_Node_Str",node.getName()) + Constants.HTML_BR);
        writeTree(node,html,packageName);
      }
    }
    if (children.size() != 0) {
      html.append("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void writeTree(Node root,StringBuffer html){
  Set<Node> children=root.getChildren();
  if (children != null) {
    html.append("String_Node_Str");
    for (    Node node : children) {
      if (node.isFlag()) {
        html.append("String_Node_Str");
        html.append(HtmlUtils.getAnchorTag("String_Node_Str","String_Node_Str" + currentPackageName + "String_Node_Str"+ node.getName()+ Constants.DOT_HTML,"String_Node_Str",node.getName()) + Constants.HTML_BR);
        writeTree(node,html);
      }
    }
    if (children.size() != 0) {
      html.append("String_Node_Str");
    }
  }
}