nus-yam/ex-repair huggingface dataset:
Program: 23162
Project: 23162
Buggy source:
private XhtmlNode addTableHeaderRowStandard(XhtmlNode t,boolean hasHierarchy,boolean hasDisplay,boolean definitions,boolean comments,boolean version,boolean deprecated,String lang){
  XhtmlNode tr=t.tr();
  if (hasHierarchy)   tr.td().b().tx("String_Node_Str");
  tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (hasDisplay)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (definitions)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (deprecated)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (comments)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (version)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  return tr;
}

Fixed version (ground truth):
private XhtmlNode addTableHeaderRowStandard(XhtmlNode t,boolean hasHierarchy,boolean hasDisplay,boolean definitions,boolean comments,boolean version,boolean deprecated,String lang){
  XhtmlNode tr=t.tr();
  if (hasHierarchy)   tr.td().b().tx("String_Node_Str");
  tr.td().attribute("String_Node_Str","String_Node_Str").b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (hasDisplay)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (definitions)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (deprecated)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (comments)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  if (version)   tr.td().b().tx(context.translator().translate("String_Node_Str","String_Node_Str",lang));
  return tr;
}
Program: 23165
Project: 23165
Buggy source:
/** 
 * Return a a datatype restriction
 * @param dataType data type to be restricted
 * @param facets List of facets
 * @return
 */
public Resource fhir_datatype_restriction(Resource dataType,List<Resource> facets){
  return fhir_bnode().addType(RDFS.Datatype).addObjectProperty(OWL2.onDatatype,dataType).addObjectProperty(OWL2.withRestrictions,new FHIRResource(model,facets)).resource;
}

Fixed version (ground truth):
/** 
 * Return a datatype restriction
 * @param dataType data type to be restricted
 * @param facets List of facets
 * @return
 */
public Resource fhir_datatype_restriction(Resource dataType,List<Resource> facets){
  return fhir_datatype(dataType).addObjectProperty(OWL2.withRestrictions,new FHIRResource(model,facets)).resource;
}
Program: 23166
Project: 23166
Buggy source:
public static Resource xsd_type_for(String type){
  String key=type.startsWith("String_Node_Str") ? type.substring(3) : type;
  return ptMap.containsKey(key) ? ptMap.get(key) : RDFNamespace.FHIR.resourceRef(key);
}

Fixed version (ground truth):
public static Resource xsd_type_for(String type,boolean owl_types_required){
  String key=type.startsWith("String_Node_Str") ? type.substring(3) : type;
  Resource rval=ptMap.containsKey(key) ? ptMap.get(key) : RDFNamespace.FHIR.resourceRef(key);
  if (owl_types_required && owlTypeMap.containsKey(rval))   rval=owlTypeMap.get(rval);
  return rval;
}
Program: 23167
Project: 23167
Buggy source:
/** 
 * DefinedStringPattern Generator
 * @param dsp FHIR DefinedStringPattern Type (e.g. id, oid, uuid)
 * @throws Exception
 */
private void genDefinedStringPattern(DefinedStringPattern dsp) throws Exception {
  String dspType=dsp.getSchema();
  String dspTypeName=dspType.endsWith("String_Node_Str") ? dspType.substring(0,dspType.length() - 1) : dspType;
  Resource dspTypeRes=RDFTypeMap.xsd_type_for(dspTypeName);
  FHIRResource dspRes=fact.fhir_class(dsp.getCode(),dsp.getBase()).addDefinition(dsp.getDefinition());
  if (dspRes != null) {
    if (dspType.endsWith("String_Node_Str")) {
      if (!owlTarget) {
        List<Resource> facets=new ArrayList<Resource>(1);
        facets.add(fact.fhir_pattern(dsp.getRegex()));
        dspRes.restriction(fact.fhir_restriction(value,fact.fhir_datatype_restriction(dspTypeRes == XSD.xstring ? XSD.normalizedString : dspTypeRes,facets)));
      }
 else       dspRes.restriction(fact.fhir_restriction(value,dspTypeRes));
    }
 else     dspRes.restriction(fact.fhir_restriction(value,dspTypeRes));
  }
}

Fixed version (ground truth):
/** 
 * DefinedStringPattern Generator
 * @param dsp FHIR DefinedStringPattern Type (e.g. id, oid, uuid)
 * @throws Exception
 */
private void genDefinedStringPattern(DefinedStringPattern dsp) throws Exception {
  String dspType=dsp.getSchema();
  String dspTypeName=dspType.endsWith("String_Node_Str") ? dspType.substring(0,dspType.length() - 1) : dspType;
  Resource dspTypeRes=RDFTypeMap.xsd_type_for(dspTypeName,owlTarget);
  FHIRResource dspRes=fact.fhir_class(dsp.getCode(),dsp.getBase()).addDefinition(dsp.getDefinition());
  if (dspRes != null) {
    if (dspType.endsWith("String_Node_Str")) {
      List<Resource> facets=new ArrayList<Resource>(1);
      facets.add(fact.fhir_pattern(dsp.getRegex()));
      dspRes.restriction(fact.fhir_restriction(value,fact.fhir_datatype_restriction(dspTypeRes == XSD.xstring ? XSD.normalizedString : dspTypeRes,facets)));
    }
 else     dspRes.restriction(fact.fhir_restriction(value,dspTypeRes));
  }
}
Program: 23168
Project: 23168
Buggy source:
/** 
 * Emit an ontology definition for the file
 */
private void genOntologyDefinition(){
  fact.fhir_ontology("String_Node_Str","String_Node_Str").addDataProperty(RDFS.comment,"String_Node_Str").addObjectProperty(OWL2.versionIRI,ResourceFactory.createResource("String_Node_Str")).addObjectProperty(OWL2.imports,RDFNamespace.W5.resourceRef("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Emit an ontology definition for the file
 */
private void genOntologyDefinition(){
  fact.fhir_ontology("String_Node_Str","String_Node_Str").addDataProperty(RDFS.comment,"String_Node_Str").addObjectProperty(OWL2.versionIRI,ResourceFactory.createResource("String_Node_Str")).addObjectProperty(OWL2.imports,ResourceFactory.createResource("String_Node_Str"));
}
Program: 23169
Project: 23169
Buggy source:
/** 
 * PrimitiveType Generator
 * @param pt FHIR Primitive Type (e.g. int, string, dateTime)
 */
private void genPrimitiveType(DefinedCode pt){
  String ptName=pt.getCode();
  FHIRResource ptRes=fact.fhir_class(ptName,"String_Node_Str").addDefinition(pt.getDefinition());
  if (!owlTarget) {
    Resource rdfType=RDFTypeMap.xsd_type_for(ptName);
    if (rdfType != null)     ptRes.restriction(fact.fhir_cardinality_restriction(value,rdfType,0,1));
  }
}

Fixed version (ground truth):
/** 
 * PrimitiveType Generator
 * @param pt FHIR Primitive Type (e.g. int, string, dateTime)
 */
private void genPrimitiveType(DefinedCode pt){
  String ptName=pt.getCode();
  FHIRResource ptRes=fact.fhir_class(ptName,"String_Node_Str").addDefinition(pt.getDefinition());
  Resource rdfType=RDFTypeMap.xsd_type_for(ptName,owlTarget);
  if (rdfType != null)   ptRes.restriction(fact.fhir_cardinality_restriction(value,fact.fhir_datatype(rdfType).resource,1,1));
}
Program: 23171
Project: 23171
Buggy source:
/** 
 * Emit all the basic atoms that are implicit in the actual model
 */
private void genBaseMetadata(){
  FHIRResource Resource=fact.fhir_class("String_Node_Str");
  FHIRResource Element=fact.fhir_class("String_Node_Str");
  FHIRResource Reference=fact.fhir_class("String_Node_Str");
  fact.fhir_class("String_Node_Str").addTitle("String_Node_Str").addDefinition("String_Node_Str").restriction(fact.fhir_restriction(value,RDFS.Literal));
  FHIRResource treeRoot=fact.fhir_class("String_Node_Str").addTitle("String_Node_Str");
  FHIRResource nodeRole=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str").domain(Resource).range(treeRoot.resource);
  Resource.restriction(fact.fhir_cardinality_restriction(nodeRole.resource,treeRoot.resource,0,1));
  FHIRResource index=fact.fhir_dataProperty("String_Node_Str").addTitle("String_Node_Str").domain(Element).range(XSD.nonNegativeInteger);
  Element.restriction(fact.fhir_cardinality_restriction(index.resource,XSD.nonNegativeInteger,0,1));
  FHIRResource link=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str");
  Reference.restriction(fact.fhir_cardinality_restriction(link.resource,Resource.resource,0,1));
  FHIRResource NarrativeDiv=fact.fhir_dataProperty("String_Node_Str");
  fact.fhir_class("String_Node_Str").domain(NarrativeDiv).range(XSD.xstring);
}

Fixed version (ground truth):
/** 
 * Emit all the basic atoms that are implicit in the actual model
 */
private void genBaseMetadata(){
  FHIRResource Resource=fact.fhir_class("String_Node_Str");
  FHIRResource Element=fact.fhir_class("String_Node_Str");
  FHIRResource Reference=fact.fhir_class("String_Node_Str");
  fact.fhir_class("String_Node_Str").addTitle("String_Node_Str").addDefinition("String_Node_Str").restriction(fact.fhir_restriction(value,RDFS.Literal));
  FHIRResource treeRoot=fact.fhir_class("String_Node_Str").addTitle("String_Node_Str");
  FHIRResource nodeRole=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str").domain(Resource).range(treeRoot.resource);
  Resource.restriction(fact.fhir_cardinality_restriction(nodeRole.resource,treeRoot.resource,0,1));
  FHIRResource index=fact.fhir_dataProperty("String_Node_Str").addTitle("String_Node_Str").domain(Element).range(XSD.nonNegativeInteger);
  Element.restriction(fact.fhir_cardinality_restriction(index.resource,XSD.nonNegativeInteger,0,1));
  FHIRResource link=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str");
  Reference.restriction(fact.fhir_cardinality_restriction(link.resource,Resource.resource,0,1));
  FHIRResource NarrativeDiv=fact.fhir_dataProperty("String_Node_Str");
  fact.fhir_class("String_Node_Str","String_Node_Str").restriction(fact.fhir_cardinality_restriction(value,fact.fhir_datatype(XSD.xstring).resource,1,1));
}
Program: 23174
Project: 23174
Buggy source:
private void scanForPages(SpecMapManager spm,String base,String folder){
  for (  File f : new File(folder).listFiles()) {
    if (f.isDirectory()) {
      scanForPages(spm,base,f.getAbsolutePath());
    }
 else     if (f.getName().equals("String_Node_Str")) {
      String s=folder.substring(0,folder.length() - 1);
      if (s.length() > base.length()) {
        s=s.substring(base.length()).replace(File.separator,"String_Node_Str");
        if (!Utilities.noString(s)) {
          spm.target(s);
          spm.target(s + "String_Node_Str");
        }
      }
    }
 else {
      String ext=f.getName().substring(f.getName().lastIndexOf("String_Node_Str"));
      if (Utilities.existsInList(ext,"String_Node_Str","String_Node_Str","String_Node_Str"))       spm.target(f.getAbsolutePath().substring(base.length()).replace(File.separator,"String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
private void scanForPages(SpecMapManager spm,String base,String folder){
  for (  File f : new File(folder).listFiles()) {
    if (f.isDirectory()) {
      scanForPages(spm,base,f.getAbsolutePath());
    }
 else     if (f.getName().equals("String_Node_Str")) {
      String s=folder.substring(0,folder.length() - 1);
      if (s.length() > base.length()) {
        s=s.substring(base.length()).replace(File.separator,"String_Node_Str");
        if (!Utilities.noString(s)) {
          spm.target(s);
          spm.target(s + "String_Node_Str");
        }
      }
    }
 else {
      String ext=f.getName().contains("String_Node_Str") ? f.getName().substring(f.getName().lastIndexOf("String_Node_Str")) : "String_Node_Str";
      if (Utilities.existsInList(ext,"String_Node_Str","String_Node_Str","String_Node_Str"))       spm.target(f.getAbsolutePath().substring(base.length()).replace(File.separator,"String_Node_Str"));
    }
  }
}
Program: 23175
Project: 23175
Buggy source:
private void scanForImages(SpecMapManager spm,String base,String folder){
  for (  File f : new File(folder).listFiles()) {
    if (f.isDirectory()) {
      scanForImages(spm,base,f.getAbsolutePath());
    }
 else {
      String ext=f.getName().substring(f.getName().lastIndexOf("String_Node_Str"));
      if (Utilities.existsInList(ext,"String_Node_Str","String_Node_Str"))       spm.image(f.getAbsolutePath().substring(base.length()).replace(File.separator,"String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
private void scanForImages(SpecMapManager spm,String base,String folder){
  for (  File f : new File(folder).listFiles()) {
    if (f.isDirectory()) {
      scanForImages(spm,base,f.getAbsolutePath());
    }
 else {
      String ext=f.getName().contains("String_Node_Str") ? f.getName().substring(f.getName().lastIndexOf("String_Node_Str")) : "String_Node_Str";
      if (Utilities.existsInList(ext,"String_Node_Str","String_Node_Str"))       spm.image(f.getAbsolutePath().substring(base.length()).replace(File.separator,"String_Node_Str"));
    }
  }
}
Program: 23177
Project: 23177
Buggy source:
private void copySearchParameters(ResourceDefn resource){
  for (  SearchParameterDefn sps : template.getSearchParams().values()) {
    if (hasPath(resource,sps.getPaths().get(0))) {
      SearchParameterDefn spt=new SearchParameterDefn(sps,template.getName(),resource.getName(),templateTitle);
      resource.getSearchParams().put(spt.getCode(),spt);
    }
  }
}

Fixed version (ground truth):
private void copySearchParameters(ResourceDefn resource){
  for (  SearchParameterDefn sps : template.getSearchParams().values()) {
    if (sps.getPaths().size() > 0 && hasPath(resource,sps.getPaths().get(0))) {
      SearchParameterDefn spt=new SearchParameterDefn(sps,template.getName(),resource.getName(),templateTitle);
      resource.getSearchParams().put(spt.getCode(),spt);
    }
  }
}
Program: 23178
Project: 23178
Buggy source:
private void genElement(StringBuilder s,int indent,ElementDefn elem,String m,int children,boolean isRoot,boolean sparse){
  if ((children == ROOT_ONLY || children == ALL)) {
    if (isRoot || sparse || hasMapping(elem,m)) {
      s.append("String_Node_Str");
      if (indent == 0) {
        s.append("String_Node_Str" + elem.getName() + "String_Node_Str");
        s.append("String_Node_Str" + elem.getName().toLowerCase() + "String_Node_Str");
      }
      for (int i=0; i < indent; i++) {
        s.append("String_Node_Str");
        s.append("String_Node_Str");
        s.append("String_Node_Str");
        s.append("String_Node_Str");
      }
      if (indent == 0)       s.append("String_Node_Str" + elem.getName() + "String_Node_Str");
 else       s.append(elem.getName());
      s.append("String_Node_Str" + Utilities.escapeXml(elem.getMappings().get(m)).replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
    }
  }
  if (!isRoot || !"String_Node_Str".equalsIgnoreCase(elem.getMappings().get(m))) {
    if (children == CHILDREN_ONLY || children == ALL) {
      for (      ElementDefn child : elem.getElements()) {
        genElement(s,indent + 1,child,m,ALL,false,sparse);
      }
    }
  }
}

Fixed version (ground truth):
private void genElement(StringBuilder s,int indent,ElementDefn elem,String m,int children,boolean isRoot,boolean sparse){
  if ((children == ROOT_ONLY || children == ALL)) {
    if (isRoot || !sparse || hasMapping(elem,m)) {
      s.append("String_Node_Str");
      if (indent == 0) {
        s.append("String_Node_Str" + elem.getName() + "String_Node_Str");
        s.append("String_Node_Str" + elem.getName().toLowerCase() + "String_Node_Str");
      }
      for (int i=0; i < indent; i++) {
        s.append("String_Node_Str");
        s.append("String_Node_Str");
        s.append("String_Node_Str");
        s.append("String_Node_Str");
      }
      if (indent == 0)       s.append("String_Node_Str" + elem.getName() + "String_Node_Str");
 else       s.append(elem.getName());
      s.append("String_Node_Str" + Utilities.escapeXml(elem.getMappings().get(m)).replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
    }
  }
  if (!isRoot || !"String_Node_Str".equalsIgnoreCase(elem.getMappings().get(m))) {
    if (children == CHILDREN_ONLY || children == ALL) {
      for (      ElementDefn child : elem.getElements()) {
        genElement(s,indent + 1,child,m,ALL,false,sparse);
      }
    }
  }
}
Program: 23181
Project: 23181
Buggy source:
public StructureMapUtilities(IWorkerContext worker,ITransformerServices services){
  super();
  this.worker=worker;
  this.library=new HashMap<String,StructureMap>();
  for (  org.hl7.fhir.r4.model.MetadataResource bc : worker.allConformanceResources()) {
    if (bc instanceof StructureMap)     library.put(bc.getUrl(),(StructureMap)bc);
  }
  this.services=services;
  fpe=new FHIRPathEngine(worker);
  fpe.setHostServices(new FFHIRPathHostServices());
}

Fixed version (ground truth):
public StructureMapUtilities(IWorkerContext worker,ITransformerServices services){
  super();
  this.worker=worker;
  loadLibrary(worker);
  this.services=services;
  fpe=new FHIRPathEngine(worker);
  fpe.setHostServices(new FFHIRPathHostServices());
}
Program: 23182
Project: 23182
Buggy source:
public Resource transform(byte[] source,FhirFormat cntType,String mapUri) throws Exception {
  StructureMapUtilities scu=new StructureMapUtilities(context);
  return null;
}

Fixed version (ground truth):
public Resource transform(byte[] source,FhirFormat cntType,String mapUri) throws Exception {
  StructureMapUtilities scu=new StructureMapUtilities(context);
  org.hl7.fhir.r4.elementmodel.Element src=Manager.parse(context,new ByteArrayInputStream(source),cntType);
  StructureMap map=scu.getLibrary().get(mapUri);
  if (map == null)   throw new Error("String_Node_Str" + mapUri);
  Resource dst=ResourceFactory.createResource("String_Node_Str");
  scu.transform(null,src,map,dst);
  return dst;
}
Program: 23188
Project: 23188
Buggy source:
private String fixedPath(String contextPath,String pathSimple){
  if (contextPath == null)   return pathSimple;
  return contextPath + "String_Node_Str" + pathSimple.substring(pathSimple.indexOf("String_Node_Str") + 1);
}

Fixed version (ground truth):
private String fixedPath(String contextPath,String pathSimple,ElementDefinition redirector){
  if (contextPath == null)   return pathSimple;
  String ptail=pathSimple.substring(pathSimple.indexOf("String_Node_Str") + 1);
  if (redirector != null)   return contextPath + "String_Node_Str" + tail(redirector.getPath())+ "String_Node_Str"+ ptail.substring(ptail.indexOf("String_Node_Str") + 1);
 else   return contextPath + "String_Node_Str" + ptail;
}
Program: 23191
Project: 23191
Buggy source:
private boolean ruleMatches(SlicingRules diff,SlicingRules base){
  return (diff == null) || (base == null) || (diff == base)|| (diff == SlicingRules.OPEN)|| ((diff == SlicingRules.OPENATEND && base == SlicingRules.CLOSED));
}

Fixed version (ground truth):
private boolean ruleMatches(SlicingRules diff,SlicingRules base){
  return (diff == null) || (base == null) || (diff == base)|| (base == SlicingRules.OPEN)|| ((diff == SlicingRules.OPENATEND && base == SlicingRules.CLOSED));
}
Program: 23192
Project: 23192
Buggy source:
public InstanceValidator(ValidationEngine engine){
  super();
  this.context=engine.getContext();
  fpe=engine.getFpe();
  this.externalHostServices=fpe.getHostServices();
  fpe.setHostServices(new ValidatorHostServices());
  source=Source.InstanceValidator;
}

Fixed version (ground truth):
public InstanceValidator(IWorkerContext theContext,IEvaluationContext hostServices){
  super();
  this.context=theContext;
  this.externalHostServices=hostServices;
  fpe=new FHIRPathEngine(context);
  fpe.setHostServices(new ValidatorHostServices());
  source=Source.InstanceValidator;
}
Program: 23193
Project: 23193
Buggy source:
public OperationOutcome validate(String location,byte[] source,FhirFormat cntType,List<String> profiles) throws Exception {
  List<ValidationMessage> messages=new ArrayList<ValidationMessage>();
  if (doNative) {
    if (cntType == FhirFormat.JSON)     validateJsonSchema(location,messages);
    if (cntType == FhirFormat.XML)     validateXmlSchema(location,messages);
    if (cntType == FhirFormat.TURTLE)     validateSHEX(location,messages);
  }
  InstanceValidator validator=new InstanceValidator(this);
  validator.setNoInvariantChecks(isNoInvariantChecks());
  validator.validate(null,messages,new ByteArrayInputStream(source),cntType,new ValidationProfileSet(profiles,true));
  return messagesToOutcome(messages);
}

Fixed version (ground truth):
public OperationOutcome validate(String location,byte[] source,FhirFormat cntType,List<String> profiles) throws Exception {
  List<ValidationMessage> messages=new ArrayList<ValidationMessage>();
  if (doNative) {
    if (cntType == FhirFormat.JSON)     validateJsonSchema(location,messages);
    if (cntType == FhirFormat.XML)     validateXmlSchema(location,messages);
    if (cntType == FhirFormat.TURTLE)     validateSHEX(location,messages);
  }
  InstanceValidator validator=new InstanceValidator(context,null);
  validator.setNoInvariantChecks(isNoInvariantChecks());
  validator.validate(null,messages,new ByteArrayInputStream(source),cntType,new ValidationProfileSet(profiles,true));
  return messagesToOutcome(messages);
}
Program: 23194
Project: 23194
Buggy source:
private void loadDefinitions(String src) throws Exception {
  Map<String,byte[]> source=loadIgSource(src,"String_Node_Str");
  if (version == null)   version=getVersionFromPack(source);
  context=SimpleWorkerContext.fromDefinitions(source,loaderForVersion());
  context.setAllowLoadingDuplicates(true);
  context.setExpansionProfile(makeExpProfile());
  fpe=new FHIRPathEngine(context);
  grabNatives(source,"String_Node_Str");
}

Fixed version (ground truth):
private void loadDefinitions(String src) throws Exception {
  Map<String,byte[]> source=loadIgSource(src,"String_Node_Str");
  if (version == null)   version=getVersionFromPack(source);
  context=SimpleWorkerContext.fromDefinitions(source,loaderForVersion());
  context.setAllowLoadingDuplicates(true);
  context.setExpansionProfile(makeExpProfile());
  grabNatives(source,"String_Node_Str");
}
Program: 23196
Project: 23196
Buggy source:
public String pseudoJson() throws Exception {
  StringBuilder b=new StringBuilder();
  ElementDefinition root=sd.getSnapshot().getElement().get(0);
  String rn=sd.getSnapshot().getElement().get(0).getPath();
  b.append("String_Node_Str" + Utilities.escapeXml(sd.getName()) + "String_Node_Str");
  List<ElementDefinition> children=getChildren(sd.getSnapshot().getElement(),sd.getSnapshot().getElement().get(0));
  boolean complex=isComplex(children);
  if (!complex)   b.append("String_Node_Str" + prefix + "String_Node_Str");
  int c=0;
  int l=lastChild(children);
  for (  ElementDefinition child : children)   if (child.hasSlicing())   generateCoreElemSliced(b,sd.getSnapshot().getElement(),child,children,2,rn,false,child.getType().get(0),++c == l,complex);
 else   if (wasSliced(child,children))   ;
 else   if (child.getType().size() == 1)   generateCoreElem(b,sd.getSnapshot().getElement(),child,2,rn,false,child.getType().get(0),++c == l,complex);
 else {
    b.append("String_Node_Str" + Utilities.escapeXml(child.getShort()) + "String_Node_Str"+ Integer.toString(child.getType().size())+ "String_Node_Str");
    for (    TypeRefComponent t : child.getType())     generateCoreElem(b,sd.getSnapshot().getElement(),child,2,rn,false,t,++c == l,false);
  }
  b.append("String_Node_Str");
  return b.toString();
}

Fixed version (ground truth):
public String pseudoJson() throws Exception {
  StringBuilder b=new StringBuilder();
  ElementDefinition root=sd.getSnapshot().getElement().get(0);
  String rn=sd.getSnapshot().getElement().get(0).getPath();
  b.append("String_Node_Str" + Utilities.escapeXml(sd.getTitle()) + "String_Node_Str");
  List<ElementDefinition> children=getChildren(sd.getSnapshot().getElement(),sd.getSnapshot().getElement().get(0));
  boolean complex=isComplex(children);
  if (!complex && !hasExtensionChild(children))   b.append("String_Node_Str" + prefix + "String_Node_Str");
  int c=0;
  int l=lastChild(children);
  for (  ElementDefinition child : children)   if (child.hasSlicing())   generateCoreElemSliced(b,sd.getSnapshot().getElement(),child,children,2,rn,false,child.getType().get(0),++c == l,complex);
 else   if (wasSliced(child,children))   ;
 else   if (child.getType().size() == 1)   generateCoreElem(b,sd.getSnapshot().getElement(),child,2,rn,false,child.getType().get(0),++c == l,complex);
 else {
    b.append("String_Node_Str" + Utilities.escapeXml(child.getShort()) + "String_Node_Str"+ Integer.toString(child.getType().size())+ "String_Node_Str");
    for (    TypeRefComponent t : child.getType())     generateCoreElem(b,sd.getSnapshot().getElement(),child,2,rn,false,t,++c == l,false);
  }
  b.append("String_Node_Str");
  return b.toString();
}
Program: 23197
Project: 23197
Buggy source:
private void writeCardinality(StringBuilder b,ElementDefinition elem) throws IOException {
  if (elem.getConstraint().size() > 0)   b.append("String_Node_Str" + Utilities.escapeXml(getInvariants(elem)) + "String_Node_Str");
  if (elem.getMin() > 0)   b.append("String_Node_Str");
}

Fixed version (ground truth):
private void writeCardinality(boolean unbounded,StringBuilder b,ElementDefinition elem) throws IOException {
  if (elem.getConstraint().size() > 0)   b.append("String_Node_Str" + Utilities.escapeXml(getInvariants(elem)) + "String_Node_Str");
  if (elem.getMin() > 0)   b.append("String_Node_Str");
  if (unbounded && "String_Node_Str".equals(elem.getMax()))   b.append("String_Node_Str");
}
Program: 23200
Project: 23200
Buggy source:
/** 
 * TypeDefinition generator (e.g. code, id, markdown, uuid)
 * @param ed definition to generate
 * @throws Exception
 */
private void genElementDefn(ElementDefn ed) throws Exception {
  String typeName=ed.getName();
  FHIRResource typeRes=(ed.getTypes().isEmpty() ? fact.fhir_class(typeName) : fact.fhir_class(typeName,"String_Node_Str")).addTitle(ed.getShortDefn()).addDefinition(ed.getDefinition());
  processTypes(typeName,typeRes,ed,typeName,false);
}

Fixed version (ground truth):
/** 
 * TypeDefinition generator (e.g. code, id, markdown, uuid)
 * @param td definition to generate
 * @throws Exception
 */
private void genElementDefn(TypeDefn td) throws Exception {
  String typeName=td.getName();
  StructureDefinition typeSd=td.getProfile();
  String parentURL=typeSd.getBaseDefinitionElement().getValue();
  String parentName=null;
  if (parentURL != null)   parentName=parentURL.substring(parentURL.lastIndexOf("String_Node_Str") + 1);
  FHIRResource typeRes=(td.getTypes().isEmpty() ? fact.fhir_class(typeName) : fact.fhir_class(typeName,parentName)).addTitle(td.getShortDefn()).addDefinition(td.getDefinition());
  processTypes(typeName,typeRes,td,typeName,false);
}
Program: 23201
Project: 23201
Buggy source:
/** 
 * Only produce the v3 vocabulary for appending to rim.ttl Placeholder - has no effect in this generation
 */
public void executeV3(Map<String,ValueSet> valuesets,Map<String,CodeSystem> codeSystems) throws Exception {
}

Fixed version (ground truth):
/** 
 * Only produce the v3 vocabulary for appending to rim.ttl Placeholder for now - has no effect in this generation
 */
public void executeV3(Map<String,ValueSet> valuesets,Map<String,CodeSystem> codeSystems) throws Exception {
}
Program: 23202
Project: 23202
Buggy source:
/** 
 * DefinedStringPattern Generator
 * @param dsp FHIR DefinedStringPattern Type (e.g. id, oid, uuid)
 * @throws Exception
 */
private void genDefinedStringPattern(DefinedStringPattern dsp) throws Exception {
  String dspType=dsp.getSchema();
  String dspTypeName=dspType.endsWith("String_Node_Str") ? dspType.substring(0,dspType.length() - 1) : dspType;
  Resource dspTypeRes=RDFTypeMap.xsd_type_for(dspTypeName);
  FHIRResource dspRes=fact.fhir_class(dsp.getCode(),dsp.getBase()).addDefinition(dsp.getDefinition());
  if (dspType.endsWith("String_Node_Str")) {
    if (!usingFact) {
      List<Resource> facets=new ArrayList<Resource>(1);
      facets.add(fact.fhir_pattern(dsp.getRegex()));
      dspRes.restriction(fact.fhir_restriction(value,fact.fhir_datatype_restriction(dspTypeRes == XSD.xstring ? XSD.normalizedString : dspTypeRes,facets)));
    }
 else     dspRes.restriction(fact.fhir_restriction(value,dspTypeRes));
  }
 else   dspRes.restriction(fact.fhir_restriction(value,dspTypeRes));
}

Fixed version (ground truth):
/** 
 * DefinedStringPattern Generator
 * @param dsp FHIR DefinedStringPattern Type (e.g. id, oid, uuid)
 * @throws Exception
 */
private void genDefinedStringPattern(DefinedStringPattern dsp) throws Exception {
  String dspType=dsp.getSchema();
  String dspTypeName=dspType.endsWith("String_Node_Str") ? dspType.substring(0,dspType.length() - 1) : dspType;
  Resource dspTypeRes=RDFTypeMap.xsd_type_for(dspTypeName);
  FHIRResource dspRes=fact.fhir_class(dsp.getCode(),dsp.getBase()).addDefinition(dsp.getDefinition());
  if (dspRes != null) {
    if (dspType.endsWith("String_Node_Str")) {
      if (!owlTarget) {
        List<Resource> facets=new ArrayList<Resource>(1);
        facets.add(fact.fhir_pattern(dsp.getRegex()));
        dspRes.restriction(fact.fhir_restriction(value,fact.fhir_datatype_restriction(dspTypeRes == XSD.xstring ? XSD.normalizedString : dspTypeRes,facets)));
      }
 else       dspRes.restriction(fact.fhir_restriction(value,dspTypeRes));
    }
 else     dspRes.restriction(fact.fhir_restriction(value,dspTypeRes));
  }
}
Program: 23203
Project: 23203
Buggy source:
public void executeMain() throws Exception {
  genOntologyDefinition();
  genBaseMetadata();
  for (  String infn : sorted(definitions.getInfrastructure().keySet()))   genElementDefn(definitions.getInfrastructure().get(infn));
  for (  String n : sorted(definitions.getTypes().keySet()))   genElementDefn(definitions.getTypes().get(n));
  for (  String n : sorted(definitions.getStructures().keySet()))   genElementDefn(definitions.getStructures().get(n));
  for (  String n : sorted(definitions.getConstraints().keySet())) {
    genProfiledType(definitions.getConstraints().get(n));
  }
  for (  String n : sorted(definitions.getBaseResources().keySet()))   genResourceDefn(definitions.getBaseResources().get(n));
  for (  String n : sorted(definitions.getResources().keySet()))   genResourceDefn(definitions.getResources().get(n));
  commit(true);
}

Fixed version (ground truth):
public void executeMain() throws Exception {
  genOntologyDefinition();
  genBaseMetadata();
  for (  String pn : sorted(definitions.getPrimitives().keySet())) {
    if (isPrimitive(pn))     genPrimitiveType(definitions.getPrimitives().get(pn));
  }
  for (  String infn : sorted(definitions.getInfrastructure().keySet()))   genElementDefn(definitions.getInfrastructure().get(infn));
  for (  String n : sorted(definitions.getTypes().keySet()))   genElementDefn(definitions.getTypes().get(n));
  for (  String n : sorted(definitions.getStructures().keySet()))   genElementDefn(definitions.getStructures().get(n));
  for (  String n : sorted(definitions.getConstraints().keySet())) {
    genProfiledType(definitions.getConstraints().get(n));
  }
  for (  String n : sorted(definitions.getBaseResources().keySet()))   genResourceDefn(definitions.getBaseResources().get(n));
  for (  String n : sorted(definitions.getResources().keySet()))   genResourceDefn(definitions.getResources().get(n));
  commit(true);
}
Program: 23204
Project: 23204
Buggy source:
/** 
 * PrimitiveType Generator
 * @param pt FHIR Primitive Type (e.g. int, string, dateTime)
 */
private void genPrimitiveType(PrimitiveType pt){
  String ptName=pt.getCode();
  String ptTypeName=pt.getSchemaType();
  Resource ptType;
  if (ptTypeName.contains("String_Node_Str")) {
    List<Resource> resItems=new ArrayList<Resource>();
    for (    String e : Arrays.asList(ptTypeName.split("String_Node_Str"))) {
      resItems.add(RDFTypeMap.xsd_type_for(e));
    }
    ptType=fact.fhir_union(resItems);
  }
 else {
    ptType=RDFTypeMap.xsd_type_for(ptTypeName);
  }
  FHIRResource ptRes=fact.fhir_class(ptName,"String_Node_Str").addDefinition(pt.getDefinition());
  if (!usingFact)   ptRes.restriction(fact.fhir_cardinality_restriction(value,ptType,0,1));
}

Fixed version (ground truth):
/** 
 * PrimitiveType Generator
 * @param pt FHIR Primitive Type (e.g. int, string, dateTime)
 */
private void genPrimitiveType(DefinedCode pt){
  String ptName=pt.getCode();
  FHIRResource ptRes=fact.fhir_class(ptName,"String_Node_Str").addDefinition(pt.getDefinition());
  if (!owlTarget) {
    Resource rdfType=RDFTypeMap.xsd_type_for(ptName);
    if (rdfType != null)     ptRes.restriction(fact.fhir_cardinality_restriction(value,rdfType,0,1));
  }
}
Program: 23206
Project: 23206
Buggy source:
/** 
 * Emit all the basic atoms that are implicit in the actual model
 */
private void genBaseMetadata(){
  FHIRResource Resource=fact.fhir_class("String_Node_Str");
  FHIRResource Element=fact.fhir_class("String_Node_Str");
  FHIRResource Reference=fact.fhir_class("String_Node_Str");
  fact.fhir_class("String_Node_Str",Element.resource).addTitle("String_Node_Str").addDefinition("String_Node_Str").restriction(fact.fhir_restriction(value,RDFS.Literal));
  FHIRResource treeRoot=fact.fhir_class("String_Node_Str").addTitle("String_Node_Str");
  FHIRResource nodeRole=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str").domain(Resource).range(treeRoot.resource);
  Resource.restriction(fact.fhir_cardinality_restriction(nodeRole.resource,treeRoot.resource,0,1));
  FHIRResource index=fact.fhir_dataProperty("String_Node_Str").addTitle("String_Node_Str").domain(Element).range(XSD.nonNegativeInteger);
  Element.restriction(fact.fhir_cardinality_restriction(index.resource,XSD.nonNegativeInteger,0,1));
  FHIRResource link=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str");
  Reference.restriction(fact.fhir_cardinality_restriction(link.resource,Resource.resource,0,1));
  fact.fhir_class("String_Node_Str",RDFNamespace.RDFXMLLiteral);
}

Fixed version (ground truth):
/** 
 * Emit all the basic atoms that are implicit in the actual model
 */
private void genBaseMetadata(){
  FHIRResource Resource=fact.fhir_class("String_Node_Str");
  FHIRResource Element=fact.fhir_class("String_Node_Str");
  FHIRResource Reference=fact.fhir_class("String_Node_Str");
  fact.fhir_class("String_Node_Str").addTitle("String_Node_Str").addDefinition("String_Node_Str").restriction(fact.fhir_restriction(value,RDFS.Literal));
  FHIRResource treeRoot=fact.fhir_class("String_Node_Str").addTitle("String_Node_Str");
  FHIRResource nodeRole=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str").domain(Resource).range(treeRoot.resource);
  Resource.restriction(fact.fhir_cardinality_restriction(nodeRole.resource,treeRoot.resource,0,1));
  FHIRResource index=fact.fhir_dataProperty("String_Node_Str").addTitle("String_Node_Str").domain(Element).range(XSD.nonNegativeInteger);
  Element.restriction(fact.fhir_cardinality_restriction(index.resource,XSD.nonNegativeInteger,0,1));
  FHIRResource link=fact.fhir_objectProperty("String_Node_Str").addTitle("String_Node_Str");
  Reference.restriction(fact.fhir_cardinality_restriction(link.resource,Resource.resource,0,1));
  FHIRResource NarrativeDiv=fact.fhir_dataProperty("String_Node_Str");
  fact.fhir_class("String_Node_Str").domain(NarrativeDiv).range(XSD.xstring);
}
Program: 23208
Project: 23208
Buggy source:
public static org.hl7.fhir.dstu3.model.BodySite convertBodySite(org.hl7.fhir.r4.model.BodyStructure src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu3.model.BodySite tgt=new org.hl7.fhir.dstu3.model.BodySite();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  if (src.hasActive())   tgt.setActive(src.getActive());
  if (src.hasCode())   tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.r4.model.CodeableConcept t : src.getQualifier())   tgt.addQualifier(convertCodeableConcept(t));
  if (src.hasDescription())   tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.r4.model.Attachment t : src.getImage())   tgt.addImage(convertAttachment(t));
  if (src.hasPatient())   tgt.setPatient(convertReference(src.getPatient()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu3.model.BodySite convertBodySite(org.hl7.fhir.r4.model.BodyStructure src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu3.model.BodySite tgt=new org.hl7.fhir.dstu3.model.BodySite();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  if (src.hasActive())   tgt.setActive(src.getActive());
  if (src.hasDescription())   tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.r4.model.Attachment t : src.getImage())   tgt.addImage(convertAttachment(t));
  if (src.hasPatient())   tgt.setPatient(convertReference(src.getPatient()));
  return tgt;
}
Program: 23210
Project: 23210
Buggy source:
@Override public ValueSetExpansionComponent expandVS(ConceptSetComponent inc,boolean heirachical) throws TerminologyServiceException {
  ValueSet vs=new ValueSet();
  vs.setCompose(new ValueSetComposeComponent());
  vs.getCompose().getInclude().add(inc);
  ValueSetExpansionOutcome vse=expandVS(vs,true,heirachical);
  ValueSet valueset=vse.getValueset();
  if (valueset == null)   throw new TerminologyServiceException("String_Node_Str" + vse.getError());
  return valueset.getExpansion();
}

Fixed version (ground truth):
@Override public ValueSetExpansionOutcome expandVS(ElementDefinitionBindingComponent binding,boolean cacheOk,boolean heirarchical) throws FHIRException {
  ValueSet vs=null;
  if (binding.hasValueSetReference()) {
    vs=fetchResource(ValueSet.class,binding.getValueSetReference().getReference());
    if (vs == null)     throw new FHIRException("String_Node_Str" + binding.getValueSetReference().getReference());
  }
 else {
    vs=fetchResource(ValueSet.class,binding.getValueSetUriType().asStringValue());
    if (vs == null)     throw new FHIRException("String_Node_Str" + binding.getValueSetUriType().asStringValue());
  }
  return expandVS(vs,cacheOk,heirarchical);
}
Program: 23211
Project: 23211
Buggy source:
public void cacheResource(Resource r) throws FHIRException {
  Map<String,Resource> map=allResourcesById.get(r.fhirType());
  if (map == null) {
    map=new HashMap<String,Resource>();
    allResourcesById.put(r.fhirType(),map);
  }
  map.put(r.getId(),r);
  if (r instanceof MetadataResource) {
    String url=((MetadataResource)r).getUrl();
    if (hasResource(r.getClass(),url) && !allowLoadingDuplicates)     throw new DefinitionException("String_Node_Str" + url);
    if (r instanceof StructureDefinition)     seeStructureDefinition(url,(StructureDefinition)r);
 else     if (r instanceof ValueSet)     seeValueSet(url,(ValueSet)r);
 else     if (r instanceof CodeSystem)     seeCodeSystem(url,(CodeSystem)r);
 else     if (r instanceof OperationDefinition)     seeOperationDefinition(url,(OperationDefinition)r);
 else     if (r instanceof Questionnaire)     seeQuestionnaire(url,(Questionnaire)r);
 else     if (r instanceof ConceptMap)     maps.put(((ConceptMap)r).getUrl(),(ConceptMap)r);
 else     if (r instanceof StructureMap)     transforms.put(((StructureMap)r).getUrl(),(StructureMap)r);
 else     if (r instanceof NamingSystem)     systems.add((NamingSystem)r);
  }
}

Fixed version (ground truth):
public void cacheResource(Resource r) throws FHIRException {
  Map<String,Resource> map=allResourcesById.get(r.fhirType());
  if (map == null) {
    map=new HashMap<String,Resource>();
    allResourcesById.put(r.fhirType(),map);
  }
  map.put(r.getId(),r);
  if (r instanceof MetadataResource) {
    String url=((MetadataResource)r).getUrl();
    if (!allowLoadingDuplicates && hasResource(r.getClass(),url))     throw new DefinitionException("String_Node_Str" + url);
    if (r instanceof StructureDefinition)     seeStructureDefinition(url,(StructureDefinition)r);
 else     if (r instanceof ValueSet)     seeValueSet(url,(ValueSet)r);
 else     if (r instanceof CodeSystem)     seeCodeSystem(url,(CodeSystem)r);
 else     if (r instanceof OperationDefinition)     seeOperationDefinition(url,(OperationDefinition)r);
 else     if (r instanceof Questionnaire)     seeQuestionnaire(url,(Questionnaire)r);
 else     if (r instanceof ConceptMap)     maps.put(((ConceptMap)r).getUrl(),(ConceptMap)r);
 else     if (r instanceof StructureMap)     transforms.put(((StructureMap)r).getUrl(),(StructureMap)r);
 else     if (r instanceof NamingSystem)     systems.add((NamingSystem)r);
  }
}
Program: 23212
Project: 23212
Buggy source:
/** 
 * Value set expanion inside the internal expansion engine - used  for references to supported system (see "supportsSystem") for which there is no value set. 
 * @param inc
 * @return
 * @throws FHIRException 
 */
public ValueSetExpansionComponent expandVS(ConceptSetComponent inc,boolean heiarchical) throws TerminologyServiceException ;

Fixed version (ground truth):
/** 
 * Value set expanion inside the internal expansion engine - used  for references to supported system (see "supportsSystem") for which there is no value set. 
 * @param inc
 * @return
 * @throws FHIRException 
 */
public ValueSetExpansionComponent expandVS(ConceptSetComponent inc,boolean heirarchical) throws TerminologyServiceException ;
Program: 23213
Project: 23213
Buggy source:
private void scanLangs(ConceptDefinitionComponent c,List<String> langs){
  for (  ConceptDefinitionDesignationComponent designation : c.getDesignation()) {
    String lang=designation.getLanguage();
    if (langs != null && !langs.contains(lang))     langs.add(lang);
  }
  for (  ConceptDefinitionComponent g : c.getConcept())   scanLangs(g,langs);
}

Fixed version (ground truth):
private void scanLangs(ConceptDefinitionComponent c,List<String> langs){
  for (  ConceptDefinitionDesignationComponent designation : c.getDesignation()) {
    if (designation.hasLanguage()) {
      String lang=designation.getLanguage();
      if (langs != null && !langs.contains(lang))       langs.add(lang);
    }
  }
  for (  ConceptDefinitionComponent g : c.getConcept())   scanLangs(g,langs);
}
Program: 23214
Project: 23214
Buggy source:
public static String nmtokenize(String cs){
  StringBuilder s=new StringBuilder();
  for (int i=0; i < cs.length(); i++) {
    char c=cs.charAt(i);
    if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')|| c == '-' || c == '_')     s.append(c);
 else     if (c != ' ')     s.append("String_Node_Str" + Integer.toString(c));
  }
  return s.toString();
}

Fixed version (ground truth):
public static String nmtokenize(String cs){
  if (cs == null)   return "String_Node_Str";
  StringBuilder s=new StringBuilder();
  for (int i=0; i < cs.length(); i++) {
    char c=cs.charAt(i);
    if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')|| c == '-' || c == '_')     s.append(c);
 else     if (c != ' ')     s.append("String_Node_Str" + Integer.toString(c));
  }
  return s.toString();
}
Program: 23215
Project: 23215
Buggy source:
protected void listChildren(List<Property> childrenList){
  super.listChildren(childrenList);
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,identifier));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,status));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,type));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,name));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,subject));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,period));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,active));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,balance));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,coverage));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,owner));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,description));
  childrenList.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,guarantor));
}

Fixed version (ground truth):
protected void listChildren(List<Property> children){
  super.listChildren(children);
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,identifier));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,status));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,type));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,name));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,subject));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,period));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,active));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,balance));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,coverage));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,owner));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,1,description));
  children.add(new Property("String_Node_Str","String_Node_Str","String_Node_Str",0,java.lang.Integer.MAX_VALUE,guarantor));
}
Program: 23216
Project: 23216
Buggy source:
private org.hl7.fhir.dstu2.model.CodeableConcept convertReferralPriorityCode(org.hl7.fhir.r4.model.ReferralRequest.ReferralPriority priority){
  org.hl7.fhir.dstu2.model.CodeableConcept cc=new org.hl7.fhir.dstu2.model.CodeableConcept();
switch (priority) {
case ROUTINE:
    cc.addCoding().setSystem("String_Node_Str").setCode("String_Node_Str");
  break;
case URGENT:
cc.addCoding().setSystem("String_Node_Str").setCode("String_Node_Str");
break;
case STAT:
cc.addCoding().setSystem("String_Node_Str").setCode("String_Node_Str");
break;
case ASAP:
cc.addCoding().setSystem("String_Node_Str").setCode("String_Node_Str");
break;
default :
return null;
}
return cc;
}

Fixed version (ground truth):
private org.hl7.fhir.r4.model.ProcedureRequest.ProcedureRequestPriority convertReferralPriorityCode(CodeableConcept priority){
  for (  org.hl7.fhir.dstu2.model.Coding c : priority.getCoding()) {
    if ("String_Node_Str".equals(c.getSystem()) && "String_Node_Str".equals(c.getCode()))     return org.hl7.fhir.r4.model.ProcedureRequest.ProcedureRequestPriority.ROUTINE;
    if ("String_Node_Str".equals(c.getSystem()) && "String_Node_Str".equals(c.getCode()))     return org.hl7.fhir.r4.model.ProcedureRequest.ProcedureRequestPriority.URGENT;
    if ("String_Node_Str".equals(c.getSystem()) && "String_Node_Str".equals(c.getCode()))     return org.hl7.fhir.r4.model.ProcedureRequest.ProcedureRequestPriority.STAT;
    if ("String_Node_Str".equals(c.getSystem()) && "String_Node_Str".equals(c.getCode()))     return org.hl7.fhir.r4.model.ProcedureRequest.ProcedureRequestPriority.ASAP;
  }
  return null;
}