nus-yam/ex-repair huggingface dataset:
Program: 24058
Project: 24058
Buggy source:
public StructureDefinition getSnapShotForProfile(String base) throws Exception {
  String[] parts=base.split("String_Node_Str");
  if (parts[0].startsWith("String_Node_Str") && parts.length == 1) {
    String name=base.substring(40);
    if (page.getDefinitions().hasResource(name))     return page.getDefinitions().getSnapShotForType(name);
 else     if (page.getDefinitions().hasType(name)) {
      TypeDefn t=page.getDefinitions().getElementDefn(name);
      if (t.getProfile().hasSnapshot())       return t.getProfile();
      throw new Exception("String_Node_Str" + name);
    }
 else     throw new Exception("String_Node_Str" + name);
  }
  StructureDefinition p=new ProfileUtilities(page.getWorkerContext(),page.getValidationErrors(),page).getProfile(null,parts[0]);
  if (p == null)   throw new Exception("String_Node_Str" + base);
  if (parts.length == 1) {
    if (p.getSnapshot() == null)     throw new Exception("String_Node_Str" + base + "String_Node_Str");
    return p;
  }
  for (  Resource r : p.getContained()) {
    if (r instanceof StructureDefinition && r.getId().equals(parts[1])) {
      StructureDefinition pc=(StructureDefinition)r;
      if (pc.getSnapshot() == null) {
        StructureDefinition ps=getSnapShotForProfile(pc.getBase());
        processProfile(pc);
      }
      return pc;
    }
  }
  throw new Exception("String_Node_Str" + base);
}

Fixed version (ground truth):
public StructureDefinition getSnapShotForProfile(String base) throws Exception {
  String[] parts=base.split("String_Node_Str");
  if (parts[0].startsWith("String_Node_Str") && parts.length == 1) {
    String name=base.substring(40);
    if (page.getDefinitions().hasResource(name))     return page.getDefinitions().getSnapShotForType(name);
 else     if (page.getDefinitions().hasType(name)) {
      TypeDefn t=page.getDefinitions().getElementDefn(name);
      if (t.getProfile().hasSnapshot())       return t.getProfile();
      throw new Exception("String_Node_Str" + name);
    }
  }
  StructureDefinition p=new ProfileUtilities(page.getWorkerContext(),page.getValidationErrors(),page).getProfile(null,parts[0]);
  if (p == null)   throw new Exception("String_Node_Str" + base);
  if (parts.length == 1) {
    if (p.getSnapshot() == null)     throw new Exception("String_Node_Str" + base + "String_Node_Str");
    return p;
  }
  for (  Resource r : p.getContained()) {
    if (r instanceof StructureDefinition && r.getId().equals(parts[1])) {
      StructureDefinition pc=(StructureDefinition)r;
      if (pc.getSnapshot() == null) {
        StructureDefinition ps=getSnapShotForProfile(pc.getBase());
        processProfile(pc);
      }
      return pc;
    }
  }
  throw new Exception("String_Node_Str" + base);
}
Program: 24059
Project: 24059
Buggy source:
private void checkFragments() throws Exception {
  for (  Fragment f : fragments) {
    String xml=f.getXml();
    ByteArrayInputStream bs=new ByteArrayInputStream(xml.getBytes());
    Document doc;
    try {
      DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
      DocumentBuilder builder=factory.newDocumentBuilder();
      doc=builder.parse(bs);
    }
 catch (    Exception e) {
      TextFile.bytesToFile(xml.getBytes(),Utilities.path(page.getFolders().dstDir,"String_Node_Str"));
      throw new Exception("String_Node_Str" + e.getMessage() + "String_Node_Str"+ Utilities.path(page.getFolders().dstDir,"String_Node_Str"),e);
    }
    org.w3c.dom.Element base=doc.getDocumentElement();
    String type=base.getAttribute("String_Node_Str");
    if (!page.getDefinitions().hasPrimitiveType(type)) {
      try {
        new org.hl7.fhir.dstu3.metamodel.XmlParser(page.getWorkerContext(),true).parse(XMLUtil.getFirstChild(base),type);
      }
 catch (      Exception e) {
        page.getValidationErrors().add(new ValidationMessage(Source.Publisher,IssueType.STRUCTURE,"String_Node_Str" + f.getPage() + "String_Node_Str"+ e.getMessage(),IssueSeverity.ERROR));
      }
    }
  }
}

Fixed version (ground truth):
private void checkFragments() throws Exception {
  for (  Fragment f : fragments) {
    String xml=f.getXml();
    DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder=factory.newDocumentBuilder();
    InputSource is=new InputSource(new StringReader(xml));
    Document doc=builder.parse(is);
    org.w3c.dom.Element base=doc.getDocumentElement();
    String type=base.getAttribute("String_Node_Str");
    if (!page.getDefinitions().hasPrimitiveType(type)) {
      try {
        new org.hl7.fhir.dstu3.metamodel.XmlParser(page.getWorkerContext(),true).parse(XMLUtil.getFirstChild(base),type);
      }
 catch (      Exception e) {
        page.getValidationErrors().add(new ValidationMessage(Source.Publisher,IssueType.STRUCTURE,"String_Node_Str" + f.getPage() + "String_Node_Str"+ e.getMessage(),IssueSeverity.ERROR));
      }
    }
  }
}
Program: 24062
Project: 24062
Buggy source:
public String generateXpath(List<String> list) throws Exception {
  StringBuilder b=new StringBuilder();
  for (  String ppath : list) {
    String path[]=splitPath(ppath);
    if (path[path.length - 1].endsWith("String_Node_Str")) {
      ElementDefn defn=definitions.getElementDefn(path[0]);
      ElementDefn ed=defn.getElementForPath(ppath,definitions,"String_Node_Str",true);
      for (      TypeRef tr : ed.getTypes()) {
        buildPath(b,path,ed.getName().substring(0,ed.getName().length() - 3) + Utilities.capitalize(tr.getName()));
      }
    }
 else     buildPath(b,path,path[path.length - 1]);
    return b.toString();
  }
  return null;
}

Fixed version (ground truth):
public String generateXpath(List<String> list) throws Exception {
  StringBuilder b=new StringBuilder();
  for (  String ppath : list) {
    String path[]=splitPath(ppath);
    if (path[path.length - 1].endsWith("String_Node_Str")) {
      ElementDefn defn=definitions.getElementDefn(path[0]);
      ElementDefn ed=defn.getElementForPath(ppath,definitions,"String_Node_Str",true);
      for (      TypeRef tr : ed.getTypes()) {
        buildPath(b,path,ed.getName().substring(0,ed.getName().length() - 3) + Utilities.capitalize(tr.getName()));
      }
    }
 else     buildPath(b,path,path[path.length - 1]);
  }
  return b.toString();
}
Program: 24067
Project: 24067
Buggy source:
private void createChildren(){
  if (element == null)   throw new Error("String_Node_Str");
  if (element instanceof JsonPrimitive) {
    if (_element != null && _element instanceof JsonObject)     for (    Entry<String,JsonElement> t : ((JsonObject)_element).entrySet())     processChild(t.getKey(),t.getValue());
  }
 else   if (element instanceof JsonObject) {
    for (    Entry<String,JsonElement> t : ((JsonObject)element).entrySet())     if (!t.getKey().equals("String_Node_Str")) {
      processChild(t.getKey(),t.getValue());
    }
  }
 else   if (element instanceof JsonNull) {
  }
 else   throw new Error("String_Node_Str" + element.getClass().getName());
}

Fixed version (ground truth):
private void createChildren(){
  if (element != null) {
    if (element instanceof JsonPrimitive) {
      if (_element != null && _element instanceof JsonObject)       for (      Entry<String,JsonElement> t : ((JsonObject)_element).entrySet())       processChild(t.getKey(),t.getValue());
    }
 else     if (element instanceof JsonObject) {
      for (      Entry<String,JsonElement> t : ((JsonObject)element).entrySet())       if (!t.getKey().equals("String_Node_Str")) {
        processChild(t.getKey(),t.getValue());
      }
    }
 else     if (element instanceof JsonNull) {
    }
 else     throw new Error("String_Node_Str" + element.getClass().getName());
  }
  if (_element != null) {
  }
}
Program: 24068
Project: 24068
Buggy source:
private void createChildren(){
  if (element == null)   throw new Error("String_Node_Str");
  if (element instanceof JsonPrimitive) {
    if (_element != null && _element instanceof JsonObject)     for (    Entry<String,JsonElement> t : ((JsonObject)_element).entrySet())     processChild(t.getKey(),t.getValue());
  }
 else   if (element instanceof JsonObject) {
    for (    Entry<String,JsonElement> t : ((JsonObject)element).entrySet())     if (!t.getKey().equals("String_Node_Str")) {
      processChild(t.getKey(),t.getValue());
    }
  }
 else   if (element instanceof JsonNull) {
  }
 else   throw new Error("String_Node_Str" + element.getClass().getName());
}

Fixed version (ground truth):
private void createChildren(){
  if (element != null) {
    if (element instanceof JsonPrimitive) {
      if (_element != null && _element instanceof JsonObject)       for (      Entry<String,JsonElement> t : ((JsonObject)_element).entrySet())       processChild(t.getKey(),t.getValue());
    }
 else     if (element instanceof JsonObject) {
      for (      Entry<String,JsonElement> t : ((JsonObject)element).entrySet())       if (!t.getKey().equals("String_Node_Str")) {
        processChild(t.getKey(),t.getValue());
      }
    }
 else     if (element instanceof JsonNull) {
    }
 else     throw new Error("String_Node_Str" + element.getClass().getName());
  }
  if (_element != null) {
  }
}
Program: 24069
Project: 24069
Buggy source:
private String describeTypes(List<TypeRefComponent> types) throws Exception {
  if (types.isEmpty())   return null;
  StringBuilder b=new StringBuilder();
  if (types.size() == 1)   describeType(b,types.get(0));
 else {
    boolean first=true;
    b.append("String_Node_Str");
    for (    TypeRefComponent t : types) {
      if (first)       first=false;
 else       b.append("String_Node_Str");
      describeType(b,t);
    }
  }
  return b.toString();
}

Fixed version (ground truth):
private String describeTypes(List<TypeRefComponent> types) throws Exception {
  if (types.isEmpty())   return "String_Node_Str";
  StringBuilder b=new StringBuilder();
  if (types.size() == 1)   describeType(b,types.get(0));
 else {
    boolean first=true;
    b.append("String_Node_Str");
    for (    TypeRefComponent t : types) {
      if (first)       first=false;
 else       b.append("String_Node_Str");
      describeType(b,t);
    }
  }
  return b.toString();
}
Program: 24070
Project: 24070
Buggy source:
private List<LinkTriple> determinePath(String n,String type,String crumbTitle){
  List<LinkTriple> res=new ArrayList<ImplementationGuideDefn.LinkTriple>();
  if (type.equals("String_Node_Str") && hasVSRegistry()) {
    res.add(new LinkTriple(ig.getPage().getSource(),ig.getId().toUpperCase(),ig.getName()));
    findPage(getVSRegistry().getSource(),res,ig.getPage().getPage());
    res.add(new LinkTriple(null,crumbTitle,null));
  }
 else   if (type.startsWith("String_Node_Str")) {
    res.add(new LinkTriple(ig.getPage().getSource(),ig.getId().toUpperCase(),ig.getName()));
    res.add(new LinkTriple(null,"String_Node_Str","String_Node_Str"));
  }
 else {
    res.add(new LinkTriple(ig.getPage().getSource(),ig.getId().toUpperCase(),ig.getName()));
    if (!n.equals(ig.getPage().getSource())) {
      if (!findPage(n,res,ig.getPage().getPage())) {
        issues.add(new ValidationMessage(Source.Publisher,IssueType.PROCESSING,code + "String_Node_Str" + n,"String_Node_Str" + n + "String_Node_Str",IssueSeverity.INFORMATION));
        res.add(new LinkTriple(null,"String_Node_Str","String_Node_Str"));
      }
    }
  }
  return res;
}

Fixed version (ground truth):
private List<LinkTriple> determinePath(String n,String type,String crumbTitle) throws Exception {
  List<LinkTriple> res=new ArrayList<ImplementationGuideDefn.LinkTriple>();
  if (type.equals("String_Node_Str") && hasVSRegistry()) {
    res.add(new LinkTriple(ig.getPage().getSource(),ig.getId().toUpperCase(),ig.getName()));
    findPage(getVSRegistry().getSource(),res,ig.getPage().getPage());
    res.add(new LinkTriple(null,crumbTitle,null));
  }
 else   if (type.startsWith("String_Node_Str")) {
    res.add(new LinkTriple(ig.getPage().getSource(),ig.getId().toUpperCase(),ig.getName()));
    res.add(new LinkTriple(null,"String_Node_Str","String_Node_Str"));
  }
 else {
    res.add(new LinkTriple(ig.getPage().getSource(),ig.getId().toUpperCase(),ig.getName()));
    if (!n.equals(ig.getPage().getSource())) {
      if (!findPage(n,res,ig.getPage().getPage()) && !findLogicalPage(n,res,ig.getPage().getPage())) {
        issues.add(new ValidationMessage(Source.Publisher,IssueType.PROCESSING,code + "String_Node_Str" + n,"String_Node_Str" + n + "String_Node_Str",IssueSeverity.INFORMATION));
        res.add(new LinkTriple(null,"String_Node_Str","String_Node_Str"));
      }
    }
  }
  return res;
}
Program: 24071
Project: 24071
Buggy source:
public String makeList(String pagename,String type,String genlevel,String crumbTitle){
  String n=pagename.replace("String_Node_Str","String_Node_Str");
  if (n.startsWith(code + File.separator))   n=n.substring(code.length() + 1);
  if (!n.endsWith("String_Node_Str"))   n=n + "String_Node_Str";
  List<LinkTriple> path=determinePath(n,type,crumbTitle);
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str" + pagename + "String_Node_Str"+ type+ "String_Node_Str"+ crumbTitle+ "String_Node_Str");
  int i=0;
  for (  LinkTriple lt : path) {
    i++;
    String t=lt.getTitle() == null ? "String_Node_Str" : "String_Node_Str" + lt.getTitle() + "String_Node_Str";
    if (i == path.size() || lt.getUrl() == null)     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
 else     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getUrl()+ "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
  }
  return b.toString();
}

Fixed version (ground truth):
public String makeList(String pagename,String type,String genlevel,String crumbTitle) throws Exception {
  String n=pagename.replace("String_Node_Str","String_Node_Str");
  if (n.startsWith(code + File.separator))   n=n.substring(code.length() + 1);
  if (!n.endsWith("String_Node_Str"))   n=n + "String_Node_Str";
  List<LinkTriple> path=determinePath(n,type,crumbTitle);
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str" + pagename + "String_Node_Str"+ type+ "String_Node_Str"+ crumbTitle+ "String_Node_Str");
  int i=0;
  for (  LinkTriple lt : path) {
    i++;
    String t=lt.getTitle() == null ? "String_Node_Str" : "String_Node_Str" + lt.getTitle() + "String_Node_Str";
    if (i == path.size() || lt.getUrl() == null)     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
 else     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getUrl()+ "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
  }
  return b.toString();
}
Program: 24074
Project: 24074
Buggy source:
@Override public boolean isIdPartValid(){
  String id=getIdPart();
  if (StringUtils.isBlank(id)) {
    return false;
  }
  if (id.length() > 64) {
    return false;
  }
  for (int i=0; i < id.length(); i++) {
    char nextChar=id.charAt(i);
    if (nextChar >= 'a' && nextChar <= 'z') {
      continue;
    }
    if (nextChar >= 'A' && nextChar <= 'Z') {
      continue;
    }
    if (nextChar >= '0' && nextChar <= '9') {
      continue;
    }
    if (nextChar == '-' || nextChar == '.') {
      continue;
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean isIdPartValid(){
  String id=getIdPart();
  if (StringUtils.isBlank(id)) {
    return false;
  }
  if (id.length() > 64) {
    return false;
  }
  for (int i=0; i < id.length(); i++) {
    char nextChar=id.charAt(i);
    if (nextChar >= 'a' && nextChar <= 'z') {
      continue;
    }
    if (nextChar >= 'A' && nextChar <= 'Z') {
      continue;
    }
    if (nextChar >= '0' && nextChar <= '9') {
      continue;
    }
    if (nextChar == '-' || nextChar == '.') {
      continue;
    }
    return false;
  }
  return true;
}
Program: 24075
Project: 24075
Buggy source:
public String getIndexPrefixForFile(String page,String logicalName){
  if (page.startsWith(code + "String_Node_Str"))   page=page.substring(code.length() + 1);
  ImplementationGuidePageComponent p=getPage(page,ig.getPage());
  if (p == null)   return sectionId + "String_Node_Str";
 else   return p.getUserString(ToolResourceUtilities.NAME_PAGE_INDEX);
}

Fixed version (ground truth):
public String getIndexPrefixForFile(String page,String logicalName){
  if (page.startsWith(code + "String_Node_Str") || page.startsWith(code + "String_Node_Str"))   page=page.substring(code.length() + 1);
  ImplementationGuidePageComponent p=getPage(page,ig.getPage());
  if (p == null)   return sectionId + "String_Node_Str";
 else   return p.getUserString(ToolResourceUtilities.NAME_PAGE_INDEX);
}
Program: 24076
Project: 24076
Buggy source:
public String makeList(String pagename,String type,String genlevel,String crumbTitle){
  String n=pagename;
  if (n.startsWith(code + File.separator))   n=n.substring(code.length() + 1);
  if (!n.endsWith("String_Node_Str"))   n=n + "String_Node_Str";
  List<LinkTriple> path=determinePath(n,type,crumbTitle);
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str" + pagename + "String_Node_Str"+ type+ "String_Node_Str"+ crumbTitle+ "String_Node_Str");
  int i=0;
  for (  LinkTriple lt : path) {
    i++;
    String t=lt.getTitle() == null ? "String_Node_Str" : "String_Node_Str" + lt.getTitle() + "String_Node_Str";
    if (i == path.size() || lt.getUrl() == null)     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
 else     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getUrl()+ "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
  }
  return b.toString();
}

Fixed version (ground truth):
public String makeList(String pagename,String type,String genlevel,String crumbTitle){
  String n=pagename.replace("String_Node_Str","String_Node_Str");
  if (n.startsWith(code + File.separator))   n=n.substring(code.length() + 1);
  if (!n.endsWith("String_Node_Str"))   n=n + "String_Node_Str";
  List<LinkTriple> path=determinePath(n,type,crumbTitle);
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str" + pagename + "String_Node_Str"+ type+ "String_Node_Str"+ crumbTitle+ "String_Node_Str");
  int i=0;
  for (  LinkTriple lt : path) {
    i++;
    String t=lt.getTitle() == null ? "String_Node_Str" : "String_Node_Str" + lt.getTitle() + "String_Node_Str";
    if (i == path.size() || lt.getUrl() == null)     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
 else     b.append("String_Node_Str" + t + "String_Node_Str"+ lt.getUrl()+ "String_Node_Str"+ lt.getDisplay()+ "String_Node_Str");
  }
  return b.toString();
}
Program: 24079
Project: 24079
Buggy source:
private void generateElementDefinition(ElementDefinition ed,ElementDefinition parent){
  DataElement de=new DataElement();
  de.setId(ed.getPath().replace("String_Node_Str","String_Node_Str"));
  if (de.getId().length() > 64)   de.setId(de.getId().substring(0,64));
  de.getMeta().setLastUpdatedElement(new InstantType(genDate));
  de.setUrl("String_Node_Str" + de.getId());
  if (dataElements != null)   dataElements.addEntry().setResource(de).setFullUrl(de.getUrl());
  de.setName(ed.getName());
  de.setStatus(ConformanceResourceStatus.DRAFT);
  de.setExperimental(true);
  de.setStringency(DataElementStringency.FULLYSPECIFIED);
  if (parent != null) {
    Extension ext=de.addExtension();
    ext.setUrl("String_Node_Str");
    Extension ext2=ext.addExtension();
    ext2.setUrl("String_Node_Str");
    ext2.setValue(new CodeType("String_Node_Str"));
    ext2=ext.addExtension();
    ext2.setUrl("String_Node_Str");
    ext2.setValue(new StringType("String_Node_Str"));
    ext2=ext.addExtension();
    ext2.setUrl("String_Node_Str");
    ext2.setValue(new UriType("String_Node_Str" + parent.getPath()));
  }
  de.addElement(ed);
}

Fixed version (ground truth):
private void generateElementDefinition(ElementDefinition ed,ElementDefinition parent){
  String id=ed.getPath().replace("String_Node_Str","String_Node_Str");
  if (id.length() > 64)   id=id.substring(0,64);
  DataElement de;
  if (des.containsKey(id)) {
    de=des.get(id);
    de.getElement().clear();
    de.getExtension().clear();
  }
 else {
    de=new DataElement();
    de.setId(id);
    des.put(id,de);
    if (dataElements != null)     dataElements.addEntry().setResource(de).setFullUrl(de.getUrl());
  }
  de.getMeta().setLastUpdatedElement(new InstantType(genDate));
  de.setUrl("String_Node_Str" + de.getId());
  de.setName(ed.getName());
  de.setStatus(ConformanceResourceStatus.DRAFT);
  de.setExperimental(true);
  de.setStringency(DataElementStringency.FULLYSPECIFIED);
  if (parent != null) {
    Extension ext=de.addExtension();
    ext.setUrl("String_Node_Str");
    Extension ext2=ext.addExtension();
    ext2.setUrl("String_Node_Str");
    ext2.setValue(new CodeType("String_Node_Str"));
    ext2=ext.addExtension();
    ext2.setUrl("String_Node_Str");
    ext2.setValue(new StringType("String_Node_Str"));
    ext2=ext.addExtension();
    ext2.setUrl("String_Node_Str");
    ext2.setValue(new UriType("String_Node_Str" + parent.getPath()));
  }
  de.addElement(ed);
}
Program: 24080
Project: 24080
Buggy source:
private boolean discriiminatorMatches(List<StringType> diff,List<StringType> base){
  if (diff.isEmpty() || base.isEmpty())   return true;
  if (diff.size() != base.size())   return false;
  for (int i=0; i < diff.size(); i++)   if (diff.get(i).getValue().equals(base.get(i).getValue()))   return false;
  return true;
}

Fixed version (ground truth):
private boolean discriiminatorMatches(List<StringType> diff,List<StringType> base){
  if (diff.isEmpty() || base.isEmpty())   return true;
  if (diff.size() != base.size())   return false;
  for (int i=0; i < diff.size(); i++)   if (!diff.get(i).getValue().equals(base.get(i).getValue()))   return false;
  return true;
}
Program: 24081
Project: 24081
Buggy source:
private boolean orderMatches(BooleanType diff,BooleanType base){
  return (diff == null) || (base == null) || (diff == base);
}

Fixed version (ground truth):
private boolean orderMatches(BooleanType diff,BooleanType base){
  return (diff == null) || (base == null) || (diff.getValue() == base.getValue());
}
Program: 24082
Project: 24082
Buggy source:
private void addToSpine(XMLWriter xml,String n) throws IOException {
  int i=getEntryIndex(n);
  xml.comment(n,false);
  xml.attribute("String_Node_Str","String_Node_Str" + Integer.toString(i));
  xml.element("String_Node_Str",null);
}

Fixed version (ground truth):
private void addToSpine(XMLWriter xml,String n) throws IOException {
  int i=getEntryIndex(n);
  if (i >= 0) {
    xml.comment(n,false);
    xml.attribute("String_Node_Str","String_Node_Str" + Integer.toString(i));
    xml.element("String_Node_Str",null);
  }
}
Program: 24083
Project: 24083
Buggy source:
public void produce() throws FileNotFoundException, Exception {
  ZipGenerator zip=new ZipGenerator(Utilities.path(page.getFolders().dstDir,"String_Node_Str" + page.getVersion() + "String_Node_Str"));
  zip.addMimeTypeFile("String_Node_Str",Utilities.path(page.getFolders().rootDir,"String_Node_Str","String_Node_Str","String_Node_Str"));
  zip.addFileName("String_Node_Str",Utilities.path(page.getFolders().rootDir,"String_Node_Str","String_Node_Str","String_Node_Str"),false);
  zip.addBytes("String_Node_Str",generateContentFile(),false);
  zip.addBytes("String_Node_Str",generateIndexFile(),false);
  build(zip);
  zip.close();
}

Fixed version (ground truth):
public void produce() throws FileNotFoundException, Exception {
  ZipGenerator zip=new ZipGenerator(Utilities.path(page.getFolders().dstDir,"String_Node_Str" + page.getVersion() + "String_Node_Str"));
  zip.addMimeTypeFile("String_Node_Str",Utilities.path(page.getFolders().rootDir,"String_Node_Str","String_Node_Str","String_Node_Str"));
  zip.addFileName("String_Node_Str",Utilities.path(page.getFolders().rootDir,"String_Node_Str","String_Node_Str","String_Node_Str"),false);
  zip.addBytes("String_Node_Str",generateContentFile(),false);
  zip.addBytes("String_Node_Str",generateIndexFile(),false);
  build(zip);
  zip.close();
  new EpubReader().readEpub(new FileInputStream(Utilities.path(page.getFolders().dstDir,"String_Node_Str" + page.getVersion() + "String_Node_Str")));
}
Program: 24088
Project: 24088
Buggy source:
public static boolean isWhitespace(String s){
  boolean ok=true;
  for (int i=0; i < s.length(); i++)   ok=ok && Character.isWhitespace(s.charAt(i));
  return ok;
}

Fixed version (ground truth):
private static boolean isWhitespace(int b){
  return b == 9 || b == 10 || b == 13 || b == 32;
}
Program: 24093
Project: 24093
Buggy source:
public ElementDefinitionHolder(ElementDefinition self){
  super();
  this.self=self;
  children=new ArrayList<ElementDefinitionHolder>();
}

Fixed version (ground truth):
public ElementDefinitionHolder(ElementDefinition self){
  super();
  this.self=self;
  this.name=self.getPath();
  children=new ArrayList<ElementDefinitionHolder>();
}
Program: 24094
Project: 24094
Buggy source:
public static String getDirectoryForFile(String filepath){
  int i=filepath.lastIndexOf(File.separator);
  if (i == -1)   return filepath;
 else   return filepath.substring(0,i);
}

Fixed version (ground truth):
public static String getDirectoryForFile(String filepath){
  File f=new File(filepath);
  return f.getParent();
}
Program: 24095
Project: 24095
Buggy source:
private void loadIgs() throws Exception {
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  DocumentBuilder builder=factory.newDocumentBuilder();
  Document xdoc=builder.parse(new CSFileInputStream(srcDir + "String_Node_Str"));
  Element root=xdoc.getDocumentElement();
  if (root.getNodeName().equals("String_Node_Str")) {
    Element ig=XMLUtil.getFirstChild(root);
    while (ig != null) {
      if (ig.getNodeName().equals("String_Node_Str")) {
        ImplementationGuide igg=new ImplementationGuide(ig.getAttribute("String_Node_Str"),ig.getAttribute("String_Node_Str"),ig.getAttribute("String_Node_Str"),ig.getAttribute("String_Node_Str"),"String_Node_Str".equals(ig.getAttribute("String_Node_Str")));
        definitions.getIgs().put(igg.getCode(),igg);
        definitions.getSortedIgs().add(igg);
      }
      ig=XMLUtil.getNextSibling(ig);
    }
  }
}

Fixed version (ground truth):
private void loadIgs() throws Exception {
  DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
  factory.setNamespaceAware(true);
  DocumentBuilder builder=factory.newDocumentBuilder();
  Document xdoc=builder.parse(new CSFileInputStream(srcDir + "String_Node_Str"));
  Element root=xdoc.getDocumentElement();
  if (root.getNodeName().equals("String_Node_Str")) {
    Element ig=XMLUtil.getFirstChild(root);
    while (ig != null) {
      if (ig.getNodeName().equals("String_Node_Str")) {
        ImplementationGuide igg=new ImplementationGuide(ig.getAttribute("String_Node_Str"),ig.getAttribute("String_Node_Str"),ig.getAttribute("String_Node_Str"),ig.getAttribute("String_Node_Str").replace('\\',File.separatorChar),"String_Node_Str".equals(ig.getAttribute("String_Node_Str")));
        definitions.getIgs().put(igg.getCode(),igg);
        definitions.getSortedIgs().add(igg);
      }
      ig=XMLUtil.getNextSibling(ig);
    }
  }
}
Program: 24096
Project: 24096
Buggy source:
private void produceIgPage(String file,ImplementationGuide ig) throws Exception {
  String logicalName=Utilities.fileTitle(file);
  String src=TextFile.fileToString(Utilities.path(page.getFolders().rootDir,Utilities.getDirectoryForFile(ig.getSource()),file));
  src=page.processPageIncludes(file,src,"String_Node_Str",null,null,null,logicalName);
  TextFile.stringToFile(src,page.getFolders().dstDir + file);
  src=addSectionNumbers(file,logicalName,src,null);
  TextFile.stringToFile(src,page.getFolders().dstDir + file);
  src=TextFile.fileToString(Utilities.path(page.getFolders().rootDir,Utilities.getDirectoryForFile(ig.getSource()),file)).replace("String_Node_Str","String_Node_Str");
  src=page.processPageIncludesForBook(file,src,"String_Node_Str",null);
  cachePage(file,src,logicalName);
}

Fixed version (ground truth):
private void produceIgPage(String file,ImplementationGuide ig) throws Exception {
  String logicalName=Utilities.fileTitle(file);
  String actualName=Utilities.path(page.getFolders().rootDir,Utilities.getDirectoryForFile(ig.getSource()),file);
  String src=TextFile.fileToString(actualName);
  src=page.processPageIncludes(file,src,"String_Node_Str",null,null,null,logicalName);
  TextFile.stringToFile(src,page.getFolders().dstDir + file);
  src=addSectionNumbers(file,logicalName,src,null);
  TextFile.stringToFile(src,page.getFolders().dstDir + file);
  src=TextFile.fileToString(actualName).replace("String_Node_Str","String_Node_Str");
  src=page.processPageIncludesForBook(file,src,"String_Node_Str",null);
  cachePage(file,src,logicalName);
}
Program: 24097
Project: 24097
Buggy source:
public static String path(String... args){
  StringBuilder s=new StringBuilder();
  boolean d=false;
  for (  String arg : args) {
    if (!d)     d=!noString(arg);
 else     if (!s.toString().endsWith(File.separator))     s.append(File.separator);
    String a=arg;
    a=a.replace("String_Node_Str",File.separator);
    if (a.startsWith(File.separator))     a=a.substring(File.separator.length());
    if ("String_Node_Str".equals(a)) {
      int i=s.substring(0,s.length() - 1).lastIndexOf(File.separator);
      s=new StringBuilder(s.substring(0,i + 1));
    }
 else     s.append(a);
  }
  return s.toString();
}

Fixed version (ground truth):
public static String path(String... args){
  StringBuilder s=new StringBuilder();
  boolean d=false;
  for (  String arg : args) {
    if (!d)     d=!noString(arg);
 else     if (!s.toString().endsWith(File.separator))     s.append(File.separator);
    String a=arg;
    a=a.replace("String_Node_Str",File.separator);
    if (s.length() > 0 && a.startsWith(File.separator))     a=a.substring(File.separator.length());
    if ("String_Node_Str".equals(a)) {
      int i=s.substring(0,s.length() - 1).lastIndexOf(File.separator);
      s=new StringBuilder(s.substring(0,i + 1));
    }
 else     s.append(a);
  }
  return s.toString();
}
Program: 24098
Project: 24098
Buggy source:
public static String path(String... args){
  StringBuilder s=new StringBuilder();
  boolean d=false;
  for (  String arg : args) {
    if (!d)     d=!noString(arg);
 else     if (!s.toString().endsWith(File.separator))     s.append(File.separator);
    s.append(arg);
  }
  return s.toString();
}

Fixed version (ground truth):
public static String path(String... args){
  StringBuilder s=new StringBuilder();
  boolean d=false;
  for (  String arg : args) {
    if (!d)     d=!noString(arg);
 else     if (!s.toString().endsWith(File.separator))     s.append(File.separator);
    String a=arg;
    a=a.replace("String_Node_Str",File.separator);
    if (a.startsWith(File.separator))     a=a.substring(File.separator.length());
    if ("String_Node_Str".equals(a)) {
      int i=s.substring(0,s.length() - 1).lastIndexOf(File.separator);
      s=new StringBuilder(s.substring(0,i + 1));
    }
 else     s.append(a);
  }
  return s.toString();
}
Program: 24099
Project: 24099
Buggy source:
@Test public void testTransactionSuccess(){
  try {
    Patient patient=buildPatient();
    OperationOutcome createdPatientEntry=testClient.create(Patient.class,patient);
    patient.setBirthDateElement(new DateType("String_Node_Str"));
    Reference patientReference=new Reference();
    patient.setId(getEntryPath(createdPatientEntry));
    patientReference.setReference(getEntryPath(createdPatientEntry));
    Observation obs=new Observation();
    obs.setSubject(patientReference);
    obs.setApplies(Factory.newDateTime("String_Node_Str"));
    OperationOutcome createdObservationEntry=testClient.create(Observation.class,obs);
    obs.setId(getEntryPath(createdObservationEntry));
    Bundle batchFeed=new Bundle();
    batchFeed.getEntry().add(new BundleEntryComponent().setResource(patient));
    batchFeed.getEntry().add(new BundleEntryComponent().setResource(obs));
    System.out.println(new String(ClientUtils.getFeedAsByteArray(batchFeed,false,false)));
    Bundle responseFeed=testClient.transaction(batchFeed);
    assertNotNull(responseFeed);
    assert(responseFeed.getEntry().get(0).getResource() instanceof Patient);
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail();
  }
}

Fixed version (ground truth):
@Test public void testTransactionSuccess(){
  try {
    Patient patient=buildPatient();
    OperationOutcome createdPatientEntry=testClient.create(Patient.class,patient);
    patient.setBirthDateElement(new DateType("String_Node_Str"));
    Reference patientReference=new Reference();
    patient.setId(getEntryPath(createdPatientEntry));
    patientReference.setReference(getEntryPath(createdPatientEntry));
    Observation obs=new Observation();
    obs.setSubject(patientReference);
    obs.setEffective(Factory.newDateTime("String_Node_Str"));
    OperationOutcome createdObservationEntry=testClient.create(Observation.class,obs);
    obs.setId(getEntryPath(createdObservationEntry));
    Bundle batchFeed=new Bundle();
    batchFeed.getEntry().add(new BundleEntryComponent().setResource(patient));
    batchFeed.getEntry().add(new BundleEntryComponent().setResource(obs));
    System.out.println(new String(ClientUtils.getFeedAsByteArray(batchFeed,false,false)));
    Bundle responseFeed=testClient.transaction(batchFeed);
    assertNotNull(responseFeed);
    assert(responseFeed.getEntry().get(0).getResource() instanceof Patient);
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail();
  }
}
Program: 24103
Project: 24103
Buggy source:
private String genIGProfilelist(){
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  List<String> names=new ArrayList<String>();
  for (  Resource ae : igResources.values()) {
    if (ae instanceof Profile)     names.add(ae.getId());
  }
  Collections.sort(names);
  for (  String s : names) {
    @SuppressWarnings("String_Node_Str") Profile ae=(Profile)igResources.get(s);
    b.append("String_Node_Str");
    b.append("String_Node_Str" + ((String)ae.getUserData("String_Node_Str")).replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ Utilities.escapeXml(ae.getName())+ "String_Node_Str");
    b.append("String_Node_Str" + Utilities.escapeXml(ae.getDescription()) + "String_Node_Str");
    b.append("String_Node_Str");
  }
  b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
private String genIGProfilelist(){
  StringBuilder b=new StringBuilder();
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  b.append("String_Node_Str");
  List<String> names=new ArrayList<String>();
  for (  Resource ae : igResources.values()) {
    if (ae instanceof Profile)     names.add(ae.getId());
  }
  Collections.sort(names);
  for (  String s : names) {
    @SuppressWarnings("String_Node_Str") Profile ae=(Profile)igResources.get(s);
    b.append("String_Node_Str");
    b.append("String_Node_Str" + ((String)ae.getUserData("String_Node_Str")).replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ Utilities.escapeXml(ae.getName())+ "String_Node_Str");
    b.append("String_Node_Str").append(Utilities.escapeXml(ae.getDescription())).append("String_Node_Str");
    b.append("String_Node_Str");
  }
  b.append("String_Node_Str");
  return b.toString();
}
Program: 24104
Project: 24104
Buggy source:
private String asText(List<CodeType> target){
  StringBuilder b=new StringBuilder();
  boolean first=true;
  for (  CodeType rn : target) {
    if (first) {
      first=false;
      b.append("String_Node_Str");
    }
 else     b.append("String_Node_Str");
    if (rn.equals("String_Node_Str"))     b.append("String_Node_Str");
 else     b.append("String_Node_Str").append(rn.getValue().toLowerCase()).append("String_Node_Str").append(rn.getValue()).append("String_Node_Str");
  }
  if (!first)   b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
private String asText(List<CodeType> target){
  StringBuilder b=new StringBuilder();
  boolean first=true;
  for (  CodeType rn : target) {
    if (first) {
      first=false;
      b.append("String_Node_Str");
    }
 else     b.append("String_Node_Str");
    final String value=rn.getValue();
    if ("String_Node_Str".equals(value))     b.append("String_Node_Str");
 else     b.append("String_Node_Str").append(value.toLowerCase()).append("String_Node_Str").append(value).append("String_Node_Str");
  }
  if (!first)   b.append("String_Node_Str");
  return b.toString();
}
Program: 24105
Project: 24105
Buggy source:
private String describeMsg(List<String> resources,List<String> aggregations){
  if (resources.size() == 0 && aggregations.size() == 0)   return "String_Node_Str";
 else {
    String s=resources.size() == 0 ? "String_Node_Str" : Utilities.asCSV(resources);
    if (aggregations.size() == 0)     return s;
 else     return s + "String_Node_Str" + Utilities.asHtmlBr("String_Node_Str" + resources.get(0),aggregations)+ "String_Node_Str";
  }
}

Fixed version (ground truth):
private String describeMsg(List<String> resources,List<String> aggregations){
  if (resources.isEmpty() && aggregations.isEmpty())   return "String_Node_Str";
 else {
    String s=resources.isEmpty() ? "String_Node_Str" : Utilities.asCSV(resources);
    if (aggregations.isEmpty())     return s;
 else     return s + "String_Node_Str" + Utilities.asHtmlBr("String_Node_Str" + resources.get(0),aggregations)+ "String_Node_Str";
  }
}
Program: 24106
Project: 24106
Buggy source:
private String genConceptMapsTable() throws Exception {
  StringBuilder s=new StringBuilder();
  s.append("String_Node_Str");
  s.append("String_Node_Str");
  List<String> sorts=new ArrayList<String>();
  sorts.addAll(conceptMaps.keySet());
  Collections.sort(sorts);
  for (  String sn : sorts) {
    ConceptMap ae=conceptMaps.get(sn);
    String n=sn.substring(23);
    ConceptMap cm=ae;
    s.append("String_Node_Str").append(ae.getUserData("String_Node_Str")).append("String_Node_Str").append(cm.getName()).append("String_Node_Str").append("String_Node_Str").append(getValueSetRef("String_Node_Str",((Reference)cm.getSource()).getReference())).append("String_Node_Str").append(describeValueSetByRef(((Reference)cm.getSource()).getReference())).append("String_Node_Str").append("String_Node_Str").append(getValueSetRef("String_Node_Str",((Reference)cm.getTarget()).getReference())).append("String_Node_Str").append(describeValueSetByRef(((Reference)cm.getTarget()).getReference())).append("String_Node_Str");
  }
  s.append("String_Node_Str");
  return s.toString();
}

Fixed version (ground truth):
private String genConceptMapsTable() throws Exception {
  StringBuilder s=new StringBuilder();
  s.append("String_Node_Str");
  s.append("String_Node_Str");
  List<String> sorts=new ArrayList<String>();
  sorts.addAll(conceptMaps.keySet());
  Collections.sort(sorts);
  for (  String sn : sorts) {
    ConceptMap ae=conceptMaps.get(sn);
    ConceptMap cm=ae;
    s.append("String_Node_Str").append(ae.getUserData("String_Node_Str")).append("String_Node_Str").append(cm.getName()).append("String_Node_Str").append("String_Node_Str").append(getValueSetRef("String_Node_Str",((Reference)cm.getSource()).getReference())).append("String_Node_Str").append(describeValueSetByRef(((Reference)cm.getSource()).getReference())).append("String_Node_Str").append("String_Node_Str").append(getValueSetRef("String_Node_Str",((Reference)cm.getTarget()).getReference())).append("String_Node_Str").append(describeValueSetByRef(((Reference)cm.getTarget()).getReference())).append("String_Node_Str");
  }
  s.append("String_Node_Str");
  return s.toString();
}
Program: 24109
Project: 24109
Buggy source:
private String combineNotes(List<String> followUps,String notes) throws Exception {
  String s="String_Node_Str";
  if (notes != null && !notes.equals("String_Node_Str"))   s=notes;
  if (followUps.size() > 0)   if (s != "String_Node_Str")   s=s + "String_Node_Str" + Utilities.asCSV(followUps);
 else   s="String_Node_Str" + Utilities.asCSV(followUps);
  return processMarkdown(s);
}

Fixed version (ground truth):
private String combineNotes(List<String> followUps,String notes) throws Exception {
  String s="String_Node_Str";
  if (notes != null && !notes.equals("String_Node_Str"))   s=notes;
  if (followUps.size() > 0)   if (!s.isEmpty())   s=s + "String_Node_Str" + Utilities.asCSV(followUps);
 else   s="String_Node_Str" + Utilities.asCSV(followUps);
  return processMarkdown(s);
}
Program: 24110
Project: 24110
Buggy source:
private String sourceSummary(ValueSet vs){
  StringBuilder b=new StringBuilder();
  List<String> done=new ArrayList<String>();
  if (vs.hasDefine()) {
    String n="String_Node_Str";
    if (vs.getDescription().contains("String_Node_Str"))     n="String_Node_Str";
    if (vs.getDescription().contains("String_Node_Str"))     n="String_Node_Str";
    if (vs.getDefine().getSystem().startsWith("String_Node_Str") && !(vs.getDefine().getSystem().startsWith("String_Node_Str")))     n="String_Node_Str";
    if (vs.getDefine().getSystem().equals("String_Node_Str"))     n="String_Node_Str";
    b.append("String_Node_Str" + n);
  }
  if (vs.hasCompose())   for (  ConceptSetComponent c : vs.getCompose().getInclude()) {
    String uri=c.getSystem();
    String n="String_Node_Str";
    if (uri != null) {
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if (uri.startsWith("String_Node_Str"))       n="String_Node_Str";
      if (uri.startsWith("String_Node_Str"))       n="String_Node_Str";
    }
    if (!done.contains(n))     b.append("String_Node_Str" + n);
    done.add(n);
  }
  return b.length() == 0 ? "String_Node_Str" : b.substring(2);
}

Fixed version (ground truth):
private String sourceSummary(ValueSet vs){
  StringBuilder b=new StringBuilder();
  List<String> done=new ArrayList<String>();
  if (vs.hasDefine()) {
    String n="String_Node_Str";
    if (vs.getDescription().contains("String_Node_Str"))     n="String_Node_Str";
    if (vs.getDescription().contains("String_Node_Str"))     n="String_Node_Str";
    if (vs.getDefine().getSystem().startsWith("String_Node_Str") && !(vs.getDefine().getSystem().startsWith("String_Node_Str")))     n="String_Node_Str";
    if (vs.getDefine().getSystem().equals("String_Node_Str"))     n="String_Node_Str";
    b.append("String_Node_Str" + n);
  }
  if (vs.hasCompose())   for (  ConceptSetComponent c : vs.getCompose().getInclude()) {
    String uri=c.getSystem();
    String n="String_Node_Str";
    if (uri != null) {
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if ("String_Node_Str".equals(uri))       n="String_Node_Str";
      if (uri.startsWith("String_Node_Str"))       n="String_Node_Str";
      if (uri.startsWith("String_Node_Str"))       n="String_Node_Str";
    }
    if (!done.contains(n))     b.append("String_Node_Str").append(n);
    done.add(n);
  }
  return b.length() == 0 ? "String_Node_Str" : b.substring(2);
}
Program: 24113
Project: 24113
Buggy source:
private void generateMetaTypeMembers(String name,boolean isResource){
  String modifier=isResource && name.equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  if (isResource)   ln("String_Node_Str" + modifier + "String_Node_Str"+ name+ "String_Node_Str");
  ln("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
  ln();
}

Fixed version (ground truth):
private void generateMetaTypeMembers(String name,boolean isResource){
  String modifier=isResource && name.equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str";
  if (isResource) {
    ln("String_Node_Str");
    ln("String_Node_Str" + modifier + "String_Node_Str"+ name+ "String_Node_Str");
  }
  ln("String_Node_Str");
  ln("String_Node_Str" + "String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
  ln();
}
Program: 24118
Project: 24118
Buggy source:
private void produceConformancePackage(String resourceName,ConformancePackage pack) throws Exception {
  for (  ProfileDefn profile : pack.getProfiles())   produceProfile(resourceName,pack,profile);
  String src=TextFile.fileToString(page.getFolders().srcDir + "String_Node_Str");
  src=page.processConformancePackageIncludes(pack,src);
  page.getEpub().registerFile(pack.getId() + "String_Node_Str","String_Node_Str" + pack.getName(),EPubManager.XHTML_TYPE);
  TextFile.stringToFile(src,page.getFolders().dstDir + pack.getId() + "String_Node_Str");
  for (  Example ex : pack.getExamples()) {
    processExample(ex,null,null);
  }
}

Fixed version (ground truth):
private void produceConformancePackage(String resourceName,ConformancePackage pack) throws Exception {
  for (  ProfileDefn profile : pack.getProfiles())   produceProfile(resourceName,pack,profile);
  String src=TextFile.fileToString(page.getFolders().srcDir + "String_Node_Str");
  src=page.processConformancePackageIncludes(pack,src);
  page.getEpub().registerFile(pack.getId() + "String_Node_Str","String_Node_Str" + pack.getName(),EPubManager.XHTML_TYPE);
  TextFile.stringToFile(src,page.getFolders().dstDir + pack.getId() + "String_Node_Str");
  for (  Example ex : pack.getExamples()) {
    processExample(ex,resourceName,null);
  }
}
Program: 24124
Project: 24124
Buggy source:
private String listTargetIds(String type) throws Exception {
  StringBuilder b=new StringBuilder();
  ResourceDefn r=page.getDefinitions().getResourceByName(type);
  if (r != null) {
    for (    Example e : r.getExamples()) {
      if (!Utilities.noString(e.getId()))       b.append(e.getId() + "String_Node_Str");
      if (e.getXml() != null) {
        if (e.getXml().getDocumentElement().getLocalName().equals("String_Node_Str")) {
          List<Element> entries=new ArrayList<Element>();
          XMLUtil.getNamedChildren(e.getXml().getDocumentElement(),"String_Node_Str",entries);
          for (          Element c : entries) {
            String id=XMLUtil.getNamedChild(c,"String_Node_Str").getTextContent();
            if (id.startsWith("String_Node_Str") && id.contains("String_Node_Str"))             b.append(id.substring(id.indexOf("String_Node_Str") + 1) + "String_Node_Str");
 else             b.append(id + "String_Node_Str");
          }
        }
      }
    }
  }
 else   b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
private String listTargetIds(String type) throws Exception {
  StringBuilder b=new StringBuilder();
  ResourceDefn r=page.getDefinitions().getResourceByName(type);
  if (r != null) {
    for (    Example e : r.getExamples()) {
      if (!Utilities.noString(e.getId()))       b.append(e.getId()).append("String_Node_Str");
      if (e.getXml() != null) {
        if (e.getXml().getDocumentElement().getLocalName().equals("String_Node_Str")) {
          List<Element> entries=new ArrayList<Element>();
          XMLUtil.getNamedChildren(e.getXml().getDocumentElement(),"String_Node_Str",entries);
          for (          Element c : entries) {
            String id=XMLUtil.getNamedChild(c,"String_Node_Str").getTextContent();
            if (id.startsWith("String_Node_Str") && id.contains("String_Node_Str"))             b.append(id.substring(id.indexOf("String_Node_Str") + 1)).append("String_Node_Str");
 else             b.append(id).append("String_Node_Str");
          }
        }
      }
    }
  }
 else   b.append("String_Node_Str");
  return b.toString();
}