nus-yam/ex-repair huggingface dataset:
Program: 22978
Project: 22978
Buggy source:
public static void convertTypeRefComponent(org.hl7.fhir.r4.model.ElementDefinition.TypeRefComponent src,List<org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent> list) throws FHIRException {
  if (src == null)   return;
  org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent tgt=new org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent();
  copyElement(src,tgt);
  tgt.setCode(src.getCode());
  list.add(tgt);
  if (src.hasTarget()) {
    for (    org.hl7.fhir.r4.model.UriType u : src.getTargetProfile()) {
      tgt.addProfile(u.getValue());
    }
  }
 else {
    for (    org.hl7.fhir.r4.model.UriType u : src.getProfile()) {
      tgt.addProfile(u.getValue());
    }
  }
}

Fixed version (ground truth):
public static void convertTypeRefComponent(org.hl7.fhir.r4.model.ElementDefinition.TypeRefComponent src,List<org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent> list) throws FHIRException {
  if (src == null)   return;
  org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent tgt=new org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent();
  copyElement(src,tgt);
  tgt.setCode(src.getCode());
  list.add(tgt);
  if (src.hasTarget()) {
    for (    org.hl7.fhir.r4.model.UriType u : src.getTargetProfile()) {
      tgt.addProfile(u.getValue());
    }
  }
 else {
    for (    org.hl7.fhir.r4.model.UriType u : src.getProfile()) {
      tgt.addProfile(u.getValue());
    }
  }
  for (  org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ElementDefinition.AggregationMode> t : src.getAggregation()) {
    org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode a=convertAggregationMode(t.getValue());
    if (!tgt.hasAggregation(a))     tgt.addAggregation(a);
  }
  if (src.hasVersioning())   tgt.setVersioning(convertReferenceVersionRules(src.getVersioning()));
}
Program: 22980
Project: 22980
Buggy source:
private void handleCompose(ValueSetComposeComponent compose,List<ValueSetExpansionParameterComponent> params,ExpansionProfile profile) throws ETooCostly, FileNotFoundException, IOException, FHIRException {
  compose.checkNoModifiers("String_Node_Str","String_Node_Str");
  for (  ConceptSetComponent inc : compose.getExclude())   excludeCodes(inc,params);
  canBeHeirarchy=!profile.getExcludeNested() && excludeKeys.isEmpty() && excludeSystems.isEmpty();
  boolean first=true;
  for (  ConceptSetComponent inc : compose.getInclude()) {
    if (first == true)     first=false;
 else     canBeHeirarchy=false;
    includeCodes(inc,params,profile);
  }
}

Fixed version (ground truth):
private void handleCompose(ValueSetComposeComponent compose,List<ValueSetExpansionParameterComponent> params,ExpansionProfile profile,String ctxt) throws ETooCostly, FileNotFoundException, IOException, FHIRException {
  compose.checkNoModifiers("String_Node_Str","String_Node_Str");
  for (  ConceptSetComponent inc : compose.getExclude())   excludeCodes(inc,params,ctxt);
  canBeHeirarchy=!profile.getExcludeNested() && excludeKeys.isEmpty() && excludeSystems.isEmpty();
  boolean first=true;
  for (  ConceptSetComponent inc : compose.getInclude()) {
    if (first == true)     first=false;
 else     canBeHeirarchy=false;
    includeCodes(inc,params,profile);
  }
}
Program: 22981
Project: 22981
Buggy source:
private Map<String,String> makeVars(FetchedResource r){
  Map<String,String> map=new HashMap<String,String>();
  if (r.getResource() != null) {
switch (r.getResource().getResourceType()) {
case StructureDefinition:
      StructureDefinition sd=(StructureDefinition)r.getResource();
    String url=sd.getBaseDefinition();
  StructureDefinition base=context.fetchResource(StructureDefinition.class,url);
if (base != null) {
  map.put("String_Node_Str",base.getName());
  map.put("String_Node_Str",base.getUserString("String_Node_Str"));
}
 else {
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
}
map.put("String_Node_Str",sd.getType());
map.put("String_Node_Str",Utilities.pluralize(sd.getType(),2));
map.put("String_Node_Str",sd.getType().toLowerCase());
map.put("String_Node_Str",Utilities.pluralize(sd.getType(),2).toLowerCase());
return map;
default :
return null;
}
}
 else return null;
}

Fixed version (ground truth):
private Map<String,String> makeVars(FetchedResource r){
  Map<String,String> map=new HashMap<String,String>();
  if (r.getResource() != null) {
switch (r.getResource().getResourceType()) {
case StructureDefinition:
      StructureDefinition sd=(StructureDefinition)r.getResource();
    String url=sd.getBaseDefinition();
  StructureDefinition base=context.fetchResource(StructureDefinition.class,url);
if (base != null) {
  map.put("String_Node_Str",base.getName());
  map.put("String_Node_Str",base.getUserString("String_Node_Str"));
}
 else {
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
}
map.put("String_Node_Str",sd.getType());
map.put("String_Node_Str",Utilities.pluralize(sd.getType(),2));
map.put("String_Node_Str",!sd.hasType() ? "String_Node_Str" : sd.getType().toLowerCase());
map.put("String_Node_Str",!sd.hasType() ? "String_Node_Str" : Utilities.pluralize(sd.getType(),2).toLowerCase());
return map;
default :
return null;
}
}
 else return null;
}
Program: 22982
Project: 22982
Buggy source:
private List<Base> opIs(List<Base> left,List<Base> right){
  List<Base> result=new ArrayList<Base>();
  if (left.size() != 1 || right.size() != 1)   result.add(new BooleanType(false).noExtensions());
 else {
    String tn=convertToString(right);
    result.add(new BooleanType(left.get(0).hasType(tn)).noExtensions());
  }
  return result;
}

Fixed version (ground truth):
private List<Base> opIs(List<Base> left,List<Base> right){
  List<Base> result=new ArrayList<Base>();
  if (left.size() != 1 || right.size() != 1)   result.add(new BooleanType(false).noExtensions());
 else {
    String tn=convertToString(right);
    if (!(left.get(0) instanceof Element) || ((Element)left.get(0)).isDisallowExtensions())     result.add(new BooleanType(Utilities.capitalize(left.get(0).fhirType()).equals(tn)).noExtensions());
 else     result.add(new BooleanType(left.get(0).hasType(tn)).noExtensions());
  }
  return result;
}
Program: 22984
Project: 22984
Buggy source:
public static boolean isAbsoluteUrl(String ref){
  return ref != null && ref.startsWith("String_Node_Str") || ref.startsWith("String_Node_Str") || ref.startsWith("String_Node_Str") || ref.startsWith("String_Node_Str");
}

Fixed version (ground truth):
public static boolean isAbsoluteUrl(String ref){
  return ref != null && (ref.startsWith("String_Node_Str") || ref.startsWith("String_Node_Str") || ref.startsWith("String_Node_Str")|| ref.startsWith("String_Node_Str"));
}
Program: 22985
Project: 22985
Buggy source:
public String process(String source,String context){
switch (dialect) {
case COMMON_MARK:
    return processCommonMark(source);
default :
  throw new Error("String_Node_Str" + dialect.toString() + "String_Node_Str"+ context);
}
}

Fixed version (ground truth):
public String process(String source,String context){
switch (dialect) {
case DARING_FIREBALL:
    return Processor.process(source);
case COMMON_MARK:
  return processCommonMark(source);
default :
throw new Error("String_Node_Str" + dialect.toString() + "String_Node_Str"+ context);
}
}
Program: 22986
Project: 22986
Buggy source:
private boolean laterDelimitedVersion(String newVersion,String oldVersion,String delimiter){
  String[] newParts=newVersion.split(delimiter);
  String[] oldParts=oldVersion.split(delimiter);
  for (int i=0; i < newParts.length; i++) {
    if (!newParts[i].equals(oldParts[i]))     return laterVersion(newParts[i],oldParts[i]);
  }
  throw new Error("String_Node_Str");
}

Fixed version (ground truth):
private boolean laterDelimitedVersion(String newVersion,String oldVersion,String delimiter){
  String[] newParts=newVersion.split(delimiter);
  String[] oldParts=oldVersion.split(delimiter);
  for (int i=0; i < newParts.length; i++) {
    if (!newParts[i].equals(oldParts[i]))     return laterVersion(newParts[i],oldParts[i]);
  }
  throw new Error("String_Node_Str" + delimiter + "String_Node_Str"+ newParts+ "String_Node_Str"+ oldParts);
}
Program: 22989
Project: 22989
Buggy source:
public void clean2(){
  definitions.getCodeSystems().clear();
  definitions.getValuesets().clear();
  conceptMaps.clear();
  profiles.clear();
  System.gc();
}

Fixed version (ground truth):
public void clean2(){
  if (definitions.getCodeSystems() != null)   definitions.getCodeSystems().clear();
  if (definitions.getValuesets() != null)   definitions.getValuesets().clear();
  System.gc();
}
Program: 22990
Project: 22990
Buggy source:
public ElementDefinitionHolder(ElementDefinition self){
  super();
  this.self=self;
  this.name=self.getPath();
  children=new ArrayList<ElementDefinitionHolder>();
}

Fixed version (ground truth):
public ElementDefinitionHolder(ElementDefinition self){
  this(self,false);
}
Program: 22991
Project: 22991
Buggy source:
private void writeElements(ElementDefinitionHolder edh,List<ElementDefinition> list){
  list.add(edh.getSelf());
  for (  ElementDefinitionHolder child : edh.getChildren()) {
    writeElements(child,list);
  }
}

Fixed version (ground truth):
private void writeElements(ElementDefinitionHolder edh,List<ElementDefinition> list){
  if (!edh.isPlaceHolder())   list.add(edh.getSelf());
  for (  ElementDefinitionHolder child : edh.getChildren()) {
    writeElements(child,list);
  }
}
Program: 22992
Project: 22992
Buggy source:
private int processElementsIntoTree(ElementDefinitionHolder edh,int i,List<ElementDefinition> list){
  String path=edh.getSelf().getPath();
  final String prefix=path + "String_Node_Str";
  while (i < list.size() && list.get(i).getPath().startsWith(prefix)) {
    ElementDefinitionHolder child=new ElementDefinitionHolder(list.get(i));
    edh.getChildren().add(child);
    i=processElementsIntoTree(child,i + 1,list);
  }
  return i;
}

Fixed version (ground truth):
private int processElementsIntoTree(ElementDefinitionHolder edh,int i,List<ElementDefinition> list){
  String path=edh.getSelf().getPath();
  final String prefix=path + "String_Node_Str";
  while (i < list.size() && list.get(i).getPath().startsWith(prefix)) {
    if (list.get(i).getPath().substring(prefix.length() + 1).contains("String_Node_Str")) {
      String newPath=prefix + list.get(i).getPath().substring(prefix.length()).split("String_Node_Str")[0];
      ElementDefinition e=new ElementDefinition(new StringType(newPath));
      ElementDefinitionHolder child=new ElementDefinitionHolder(e,true);
      edh.getChildren().add(child);
      i=processElementsIntoTree(child,i,list);
    }
 else {
      ElementDefinitionHolder child=new ElementDefinitionHolder(list.get(i));
      edh.getChildren().add(child);
      i=processElementsIntoTree(child,i + 1,list);
    }
  }
  return i;
}
Program: 22995
Project: 22995
Buggy source:
private void addNode(List<Piece> list,XhtmlNode c){
  if (c.getNodeType() == NodeType.Text)   list.add(new Piece(null,c.getContent(),null));
 else   if (c.getNodeType() == NodeType.Element) {
    if (c.getName().equals("String_Node_Str")) {
      list.add(new Piece(c.getAttribute("String_Node_Str"),c.allText(),c.getAttribute("String_Node_Str")));
    }
 else     if (c.getName().equals("String_Node_Str") || c.getName().equals("String_Node_Str")) {
      list.add(new Piece(null,c.allText(),null).setStyle("String_Node_Str"));
    }
 else     if (c.getName().equals("String_Node_Str")) {
      list.add(new Piece(null,c.allText(),null).setStyle("String_Node_Str"));
    }
 else     if (c.getName().equals("String_Node_Str")) {
      list.add(new Piece(null,c.allText(),null).setStyle("String_Node_Str"));
    }
 else     throw new Error("String_Node_Str" + c.getName());
  }
 else   throw new Error("String_Node_Str" + c.getNodeType().toString());
}

Fixed version (ground truth):
private void addNode(List<Piece> list,XhtmlNode c){
  if (c.getNodeType() == NodeType.Text)   list.add(new Piece(null,c.getContent(),null));
 else   if (c.getNodeType() == NodeType.Element) {
    if (c.getName().equals("String_Node_Str")) {
      list.add(new Piece(c.getAttribute("String_Node_Str"),c.allText(),c.getAttribute("String_Node_Str")));
    }
 else     if (c.getName().equals("String_Node_Str") || c.getName().equals("String_Node_Str") || c.getName().equals("String_Node_Str")) {
      list.add(new Piece(null,c.allText(),null).setStyle("String_Node_Str"));
    }
 else     if (c.getName().equals("String_Node_Str")) {
      list.add(new Piece(null,c.allText(),null).setStyle("String_Node_Str"));
    }
 else     if (c.getName().equals("String_Node_Str")) {
      list.add(new Piece(null,c.allText(),null).setStyle("String_Node_Str"));
    }
 else     if (c.getName().equals("String_Node_Str") || c.getName().equals("String_Node_Str")) {
      Piece p=new Piece(c.getName());
      list.add(p);
      p.getChildren().addAll(c.getChildNodes());
    }
 else     if (c.getName().equals("String_Node_Str")) {
      list.add(new Piece(null,c.allText(),null).setStyle("String_Node_Str"));
    }
 else     throw new Error("String_Node_Str" + c.getName());
  }
 else   throw new Error("String_Node_Str" + c.getNodeType().toString());
}
Program: 22997
Project: 22997
Buggy source:
public List<XhtmlNode> getChildren(){
  return children;
}

Fixed version (ground truth):
public List<XhtmlNode> getChildren(){
  if (children == null)   children=new ArrayList<XhtmlNode>();
  return children;
}
Program: 22999
Project: 22999
Buggy source:
@Override public Base resolveReference(Object appContext,String url){
  throw new NotImplementedException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Base resolveReference(Object appContext,String url){
  if (appContext instanceof Element) {
    Element bnd=(Element)appContext;
    if (bnd.fhirType().equals("String_Node_Str")) {
      for (      Element be : bnd.getChildrenByName("String_Node_Str")) {
        Element res=be.getNamedChild("String_Node_Str");
        if (res != null) {
          String fullUrl=be.getChildValue("String_Node_Str");
          String rt=res.fhirType();
          String id=res.getChildValue("String_Node_Str");
          if (url.equals(fullUrl))           return res;
          if (url.equals(rt + "String_Node_Str" + id))           return res;
        }
      }
    }
    return null;
  }
  throw new NotImplementedException("String_Node_Str" + appContext.toString() + "String_Node_Str"+ url+ "String_Node_Str");
}
Program: 23000
Project: 23000
Buggy source:
@Override public Base resolveConstant(Object appContext,String name) throws PathEngineException {
  if ("String_Node_Str".equals(name))   return null;
  throw new NotImplementedException("String_Node_Str" + appContext.toString() + "String_Node_Str"+ name+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public Base resolveConstant(Object appContext,String name) throws PathEngineException {
  return null;
}
Program: 23001
Project: 23001
Buggy source:
@Override public Base resolveConstant(Object appContext,String name) throws PathEngineException {
  throw new NotImplementedException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Base resolveConstant(Object appContext,String name) throws PathEngineException {
  if ("String_Node_Str".equals(name))   return null;
  throw new NotImplementedException("String_Node_Str" + appContext.toString() + "String_Node_Str"+ name+ "String_Node_Str");
}
Program: 23002
Project: 23002
Buggy source:
private String getSpecialValueSetName(String uri){
  if (uri.startsWith("String_Node_Str"))   return "String_Node_Str" + uri.substring(19);
  return null;
}

Fixed version (ground truth):
private String getSpecialValueSetName(String uri){
  if (uri.startsWith("String_Node_Str"))   return "String_Node_Str" + uri.substring(20);
  return null;
}
Program: 23003
Project: 23003
Buggy source:
/** 
 * @param value {@link #rate} (Amount of medication per unit of time.)
 */
public Dosage setRate(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof Ratio || value instanceof Range || value instanceof SimpleQuantity))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.rate=value;
  return this;
}

Fixed version (ground truth):
/** 
 * @param value {@link #rate} (Amount of medication per unit of time.)
 */
public Dosage setRate(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof Ratio || value instanceof Range || value instanceof Quantity))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.rate=value;
  return this;
}
Program: 23004
Project: 23004
Buggy source:
/** 
 * @param value {@link #dose} (Amount of medication per dose.)
 */
public Dosage setDose(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof Range || value instanceof SimpleQuantity))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.dose=value;
  return this;
}

Fixed version (ground truth):
/** 
 * @param value {@link #dose} (Amount of medication per dose.)
 */
public Dosage setDose(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof Range || value instanceof Quantity))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.dose=value;
  return this;
}
Program: 23005
Project: 23005
Buggy source:
/** 
 * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient.  Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.)
 */
public MedicationAdministrationDosageComponent setRate(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof Ratio || value instanceof SimpleQuantity))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.rate=value;
  return this;
}

Fixed version (ground truth):
/** 
 * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient.  Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.)
 */
public MedicationAdministrationDosageComponent setRate(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof Ratio || value instanceof Quantity))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.rate=value;
  return this;
}
Program: 23006
Project: 23006
Buggy source:
/** 
 * @param value {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.)
 */
public NutritionOrderEnteralFormulaAdministrationComponent setRate(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof SimpleQuantity || value instanceof Ratio))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.rate=value;
  return this;
}

Fixed version (ground truth):
/** 
 * @param value {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.)
 */
public NutritionOrderEnteralFormulaAdministrationComponent setRate(Type value) throws FHIRFormatError {
  if (value != null && !(value instanceof Quantity || value instanceof Ratio))   throw new FHIRFormatError("String_Node_Str" + value.fhirType());
  this.rate=value;
  return this;
}
Program: 23007
Project: 23007
Buggy source:
private void validate(FetchedFile file,FetchedResource r) throws Exception {
  List<ValidationMessage> errs=new ArrayList<ValidationMessage>();
  if (r.isValidateByUserData()) {
    Resource res=r.getResource();
    if (res instanceof Bundle) {
      validator.validate(null,errs,r.getElement());
      for (      BundleEntryComponent be : ((Bundle)res).getEntry()) {
        Resource ber=be.getResource();
        if (ber.hasUserData("String_Node_Str"))         validator.validate(r.getElement(),errs,ber,ber.getUserString("String_Node_Str"));
      }
    }
 else     if (res.hasUserData("String_Node_Str")) {
      validator.validate(null,errs,res,res.getUserString("String_Node_Str"));
    }
  }
 else   validator.validate(null,errs,r.getElement());
  for (  ValidationMessage vm : errs) {
    file.getErrors().add(vm.setLocation(r.getElement().fhirType() + "String_Node_Str" + r.getId()+ "String_Node_Str"+ vm.getLocation()));
  }
  r.setValidated(true);
  if (r.getConfig() == null)   igpkp.findConfiguration(file,r);
}

Fixed version (ground truth):
private void validate(FetchedFile file,FetchedResource r) throws Exception {
  List<ValidationMessage> errs=new ArrayList<ValidationMessage>();
  if (r.isValidateByUserData()) {
    Resource res=r.getResource();
    if (res instanceof Bundle) {
      validator.validate(null,errs,r.getElement());
      for (      BundleEntryComponent be : ((Bundle)res).getEntry()) {
        Resource ber=be.getResource();
        if (ber.hasUserData("String_Node_Str"))         validator.validate(r.getElement(),errs,ber,ber.getUserString("String_Node_Str"));
      }
    }
 else     if (res.hasUserData("String_Node_Str")) {
      validator.validate(null,errs,res,res.getUserString("String_Node_Str"));
    }
  }
 else {
    validator.validate(r.getElement(),errs,r.getElement());
  }
  for (  ValidationMessage vm : errs) {
    file.getErrors().add(vm.setLocation(r.getElement().fhirType() + "String_Node_Str" + r.getId()+ "String_Node_Str"+ vm.getLocation()));
  }
  r.setValidated(true);
  if (r.getConfig() == null)   igpkp.findConfiguration(file,r);
}
Program: 23010
Project: 23010
Buggy source:
public static org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt=new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent();
  copyElement(src,tgt);
  tgt.setStrength(convertBindingStrength(src.getStrength()));
  tgt.setValueSet(convertType(src.getValueSet()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent convertOperationDefinitionParameterBindingComponent(org.hl7.fhir.r4.model.OperationDefinition.OperationDefinitionParameterBindingComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent tgt=new org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationDefinitionParameterBindingComponent();
  copyElement(src,tgt);
  tgt.setStrength(convertBindingStrength(src.getStrength()));
  tgt.setValueSet(src.getValueSet() instanceof CanonicalType ? convertCanonicalToReference((CanonicalType)src.getValueSet()) : convertType(src.getValueSet()));
  return tgt;
}
Program: 23012
Project: 23012
Buggy source:
private SpecificationPackage loadPack(String fn) throws FHIRException, IOException {
  if ("String_Node_Str".equals(version)) {
    return SpecificationPackage.fromPath(fn,new R2ToR4Loader());
  }
 else   if ("String_Node_Str".equals(version)) {
    return SpecificationPackage.fromPath(fn,new R3ToR4Loader());
  }
 else   if ("String_Node_Str".equals(version)) {
    return SpecificationPackage.fromPath(fn,new R3ToR4Loader());
  }
 else   return SpecificationPackage.fromPath(fn);
}

Fixed version (ground truth):
private SpecificationPackage loadPack(String fn) throws FHIRException, IOException {
  SpecificationPackage sp=null;
  if ("String_Node_Str".equals(version)) {
    sp=SpecificationPackage.fromPath(fn,new R2ToR4Loader());
  }
 else   if ("String_Node_Str".equals(version)) {
    sp=SpecificationPackage.fromPath(fn,new R2016MayToR4Loader());
  }
 else   if ("String_Node_Str".equals(version)) {
    sp=SpecificationPackage.fromPath(fn,new R3ToR4Loader());
  }
 else   return SpecificationPackage.fromPath(fn);
  ProfileUtilities utils=new ProfileUtilities(context,new ArrayList<ValidationMessage>(),igpkp);
  for (  StructureDefinition sd : sp.makeContext().allStructures()) {
    utils.setIds(sd,true);
  }
  return sp;
}
Program: 23014
Project: 23014
Buggy source:
public void compose(Element e,IXMLWriter xml) throws Exception {
  xml.start();
  xml.setDefaultNamespace(e.getProperty().getNamespace());
  composeElement(xml,e,e.getType());
  xml.end();
}

Fixed version (ground truth):
public void compose(Element e,IXMLWriter xml) throws Exception {
  xml.start();
  xml.setDefaultNamespace(e.getProperty().getNamespace());
  composeElement(xml,e,e.getType(),true);
  xml.end();
}
Program: 23018
Project: 23018
Buggy source:
private Resource parse(FetchedFile file) throws Exception {
  String parseVersion=version;
  if (!file.getResources().isEmpty())   parseVersion=str(file.getResources().get(0).getConfig(),"String_Node_Str",version);
  if (parseVersion.equals("String_Node_Str") || parseVersion.equals("String_Node_Str")) {
    org.hl7.fhir.dstu3.model.Resource res;
    if (file.getContentType().contains("String_Node_Str"))     res=new org.hl7.fhir.dstu3.formats.JsonParser().parse(file.getSource());
 else     if (file.getContentType().contains("String_Node_Str"))     res=new org.hl7.fhir.dstu3.formats.XmlParser().parse(file.getSource());
 else     throw new Exception("String_Node_Str" + file.getName());
    return VersionConvertor_30_40.convertResource(res);
  }
 else   if (parseVersion.equals("String_Node_Str")) {
    org.hl7.fhir.dstu2016may.model.Resource res;
    if (file.getContentType().contains("String_Node_Str"))     res=new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(file.getSource());
 else     if (file.getContentType().contains("String_Node_Str"))     res=new org.hl7.fhir.dstu2016may.formats.XmlParser().parse(file.getSource());
 else     throw new Exception("String_Node_Str" + file.getName());
    return VersionConvertor_14_40.convertResource(res);
  }
 else   if (parseVersion.equals("String_Node_Str")) {
    org.hl7.fhir.dstu2.model.Resource res;
    if (file.getContentType().contains("String_Node_Str"))     res=new org.hl7.fhir.dstu2.formats.JsonParser().parse(file.getSource());
 else     if (file.getContentType().contains("String_Node_Str"))     res=new org.hl7.fhir.dstu2.formats.XmlParser().parse(file.getSource());
 else     throw new Exception("String_Node_Str" + file.getName());
    VersionConvertorAdvisor40 advisor=new IGR2ConvertorAdvisor();
    return new VersionConvertor_10_40(advisor).convertResource(res);
  }
 else   if (parseVersion.equals(Constants.VERSION)) {
    if (file.getContentType().contains("String_Node_Str"))     return new JsonParser().parse(file.getSource());
 else     if (file.getContentType().contains("String_Node_Str"))     return new XmlParser().parse(file.getSource());
 else     throw new Exception("String_Node_Str" + file.getName());
  }
 else   throw new Exception("String_Node_Str" + parseVersion);
}

Fixed version (ground truth):
private Resource parse(FetchedFile file) throws Exception {
  String parseVersion=version;
  if (!file.getResources().isEmpty())   parseVersion=str(file.getResources().get(0).getConfig(),"String_Node_Str",version);
  return parseContent(file.getName(),file.getContentType(),parseVersion,file.getSource());
}
Program: 23020
Project: 23020
Buggy source:
private MetadataResource findTxValueSet(String uri){
  MetadataResource res=expansionCache.getStoredResource(uri);
  if (res != null)   return res;
  try {
    res=txServer.getCanonical(ValueSet.class,uri);
  }
 catch (  Exception e) {
    return null;
  }
  if (res != null)   try {
    expansionCache.storeResource(res);
  }
 catch (  IOException e) {
  }
  return res;
}

Fixed version (ground truth):
private MetadataResource findTxValueSet(String uri){
  MetadataResource res=expansionCache.getStoredResource(uri);
  if (res != null)   return res;
synchronized (lock) {
    if (notCanonical.contains(uri))     return null;
  }
  try {
    tlog("String_Node_Str" + uri);
    res=txServer.getCanonical(ValueSet.class,uri);
  }
 catch (  Exception e) {
synchronized (lock) {
      notCanonical.add(uri);
    }
    return null;
  }
  if (res != null)   try {
    expansionCache.storeResource(res);
  }
 catch (  IOException e) {
  }
  return res;
}
Program: 23022
Project: 23022
Buggy source:
private ValidationResult verifyCodeExternal(ValueSet vs,CodeableConcept cc,boolean tryCache) throws Exception {
  ValidationResult res=handleByCache(vs,cc,tryCache);
  if (res != null)   return res;
  Parameters pin=new Parameters();
  pin.addParameter().setName("String_Node_Str").setValue(cc);
  pin.addParameter().setName("String_Node_Str").setResource(vs);
  res=serverValidateCode(pin,false);
  Map<String,ValidationResult> cache=validationCache.get(vs.getUrl());
  cache.put(cacheId(cc),res);
  return res;
}

Fixed version (ground truth):
private ValidationResult verifyCodeExternal(ValueSet vs,CodeableConcept cc,boolean tryCache) throws Exception {
  ValidationResult res=handleByCache(vs,cc,tryCache);
  if (res != null)   return res;
  Parameters pin=new Parameters();
  pin.addParameter().setName("String_Node_Str").setValue(cc);
  pin.addParameter().setName("String_Node_Str").setResource(vs);
  res=serverValidateCode(pin,tryCache);
  Map<String,ValidationResult> cache=validationCache.get(vs.getUrl());
  cache.put(cacheId(cc),res);
  return res;
}
Program: 23023
Project: 23023
Buggy source:
public void initTS(String cachePath) throws Exception {
  cache=cachePath;
  expansionCache=new ValueSetExpansionCache(this,null);
  validationCachePath=Utilities.path(cachePath,"String_Node_Str");
  try {
    loadValidationCache();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void initTS(String cachePath) throws Exception {
  cache=cachePath;
  expansionCache=new ValueSetExpansionCache(this,null,lock);
  validationCachePath=Utilities.path(cachePath,"String_Node_Str");
  try {
    loadValidationCache();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 23024
Project: 23024
Buggy source:
private void tlog(String msg){
}

Fixed version (ground truth):
protected void tlog(String msg){
  System.out.println("String_Node_Str" + msg);
}
Program: 23025
Project: 23025
Buggy source:
public String connectToTSServer(FHIRToolingClient client) throws URISyntaxException {
  txServer=client;
  return txServer.getCapabilitiesStatementQuick().getSoftware().getVersion();
}

Fixed version (ground truth):
public String connectToTSServer(FHIRToolingClient client) throws URISyntaxException {
  tlog("String_Node_Str" + client.getAddress());
  txServer=client;
  return txServer.getCapabilitiesStatementQuick().getSoftware().getVersion();
}
Program: 23026
Project: 23026
Buggy source:
public void storeResource(MetadataResource md) throws IOException {
  canonicals.put(md.getUrl(),md);
  if (md.hasVersion())   canonicals.put(md.getUrl() + "String_Node_Str" + md.getVersion(),md);
  if (cacheFolder != null) {
    FileOutputStream s=new FileOutputStream(Utilities.path(cacheFolder,makeFileName(md.getUrl() + "String_Node_Str" + md.getVersion())));
    context.newXmlParser().setOutputStyle(OutputStyle.PRETTY).compose(s,md);
    s.close();
  }
}

Fixed version (ground truth):
public void storeResource(MetadataResource md) throws IOException {
synchronized (lock) {
    canonicals.put(md.getUrl(),md);
    if (md.hasVersion())     canonicals.put(md.getUrl() + "String_Node_Str" + md.getVersion(),md);
  }
  if (cacheFolder != null) {
    FileOutputStream s=new FileOutputStream(Utilities.path(cacheFolder,makeFileName(md.getUrl() + "String_Node_Str" + md.getVersion())));
    context.newXmlParser().setOutputStyle(OutputStyle.PRETTY).compose(s,md);
    s.close();
  }
}
Program: 23027
Project: 23027
Buggy source:
public ValueSetExpansionCache(IWorkerContext context,String cacheFolder) throws FHIRFormatError, IOException {
  super();
  this.context=context;
  this.cacheFolder=cacheFolder;
  if (this.cacheFolder != null)   loadCache();
}

Fixed version (ground truth):
public ValueSetExpansionCache(IWorkerContext context,String cacheFolder,Object lock) throws FHIRFormatError, IOException {
  super();
  this.context=context;
  this.cacheFolder=cacheFolder;
  this.lock=lock;
  if (this.cacheFolder != null)   loadCache();
}
Program: 23028
Project: 23028
Buggy source:
public MetadataResource getStoredResource(String canonicalUri){
  return canonicals.get(canonicalUri);
}

Fixed version (ground truth):
public MetadataResource getStoredResource(String canonicalUri){
synchronized (lock) {
    return canonicals.get(canonicalUri);
  }
}
Program: 23029
Project: 23029
Buggy source:
@Override public String getLinkForProfile(StructureDefinition profile,String url){
  StructureDefinition sd=context.fetchResource(StructureDefinition.class,url);
  if (sd != null && sd.hasUserData("String_Node_Str"))   return sd.getUserString("String_Node_Str") + "String_Node_Str" + sd.getName();
  brokenLinkWarning("String_Node_Str",url);
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getLinkForProfile(StructureDefinition profile,String url){
  StructureDefinition sd=context.fetchResource(StructureDefinition.class,url);
  if (noXhtml && sd != null && sd.getType().equals("String_Node_Str"))   return null;
  if (sd != null && sd.hasUserData("String_Node_Str"))   return sd.getUserString("String_Node_Str") + "String_Node_Str" + sd.getName();
  brokenLinkWarning("String_Node_Str",url);
  return "String_Node_Str";
}
Program: 23030
Project: 23030
Buggy source:
public IGKnowledgeProvider(IWorkerContext context,String pathToSpec,JsonObject igs,List<ValidationMessage> errors) throws Exception {
  super();
  this.context=context;
  this.pathToSpec=pathToSpec;
  if (this.pathToSpec.endsWith("String_Node_Str"))   this.pathToSpec=this.pathToSpec.substring(0,this.pathToSpec.length() - 1);
  this.errors=errors;
  loadPaths(igs);
}

Fixed version (ground truth):
public IGKnowledgeProvider(IWorkerContext context,String pathToSpec,JsonObject igs,List<ValidationMessage> errors,boolean noXhtml) throws Exception {
  super();
  this.context=context;
  this.pathToSpec=pathToSpec;
  if (this.pathToSpec.endsWith("String_Node_Str"))   this.pathToSpec=this.pathToSpec.substring(0,this.pathToSpec.length() - 1);
  this.errors=errors;
  this.noXhtml=noXhtml;
  loadPaths(igs);
}
Program: 23032
Project: 23032
Buggy source:
private String getSrcFile(String code){
  StructureDefinition sd=context.fetchResource(StructureDefinition.class,"String_Node_Str" + code);
  if (sd == null)   return "String_Node_Str";
 else {
    String l=igp.getLinkForProfile(this.sd,sd.getUrl());
    if (l.contains("String_Node_Str"))     l=l.substring(0,l.indexOf("String_Node_Str"));
    return l;
  }
}

Fixed version (ground truth):
private String getSrcFile(String code){
  StructureDefinition sd=context.fetchResource(StructureDefinition.class,"String_Node_Str" + code);
  if (sd == null)   return "String_Node_Str";
 else {
    String l=igp.getLinkForProfile(this.sd,sd.getUrl());
    if (l == null)     return null;
    if (l.contains("String_Node_Str"))     l=l.substring(0,l.indexOf("String_Node_Str"));
    return l;
  }
}
Program: 23037
Project: 23037
Buggy source:
public Base parseType(String xml,String type) throws IOException, FHIRException {
  if (parser != null)   return parser.parseType(xml,type);
 else   return new XmlParser().parseType(xml,type);
}

Fixed version (ground truth):
public Base parseType(String xml,String type) throws IOException, FHIRException {
  if (parser != null)   return parser.parseType(xml,type);
 else   return new XmlParser().parseAnyType(xml,type);
}
Program: 23041
Project: 23041
Buggy source:
public static void convertTypeRefComponent(org.hl7.fhir.r4.model.ElementDefinition.TypeRefComponent src,List<org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent> list) throws FHIRException {
  if (src == null)   return;
  org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent tgt=new org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent();
  copyElement(src,tgt);
  tgt.setCode(src.getCode());
  list.add(tgt);
  if (src.hasTarget()) {
    if (src.hasProfile())     tgt.setProfile(src.getProfile().get(0).getValue());
    for (    org.hl7.fhir.r4.model.UriType u : src.getTargetProfile()) {
      if (tgt.hasTargetProfile()) {
        tgt=new org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent();
        copyElement(src,tgt);
        tgt.setCode(src.getCode());
        if (src.hasProfile())         tgt.setProfile(src.getProfile().get(0).getValue());
      }
      tgt.setTargetProfile(u.getValue());
    }
  }
 else {
    for (    org.hl7.fhir.r4.model.UriType u : src.getProfile()) {
      if (tgt.hasProfile()) {
        tgt=new org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent();
        list.add(tgt);
        copyElement(src,tgt);
        tgt.setCode(src.getCode());
      }
      tgt.setProfile(u.getValue());
    }
  }
}

Fixed version (ground truth):
public static void convertTypeRefComponent(org.hl7.fhir.r4.model.ElementDefinition.TypeRefComponent src,List<org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent> list) throws FHIRException {
  if (src == null)   return;
  org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent tgt=new org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent();
  copyElement(src,tgt);
  tgt.setCode(src.getCode());
  list.add(tgt);
  if (src.hasTarget()) {
    if (src.hasProfile())     tgt.setProfile(src.getProfile().get(0).getValue());
    for (    org.hl7.fhir.r4.model.UriType u : src.getTargetProfile()) {
      if (tgt.hasTargetProfile()) {
        tgt=new org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent();
        list.add(tgt);
        copyElement(src,tgt);
        tgt.setCode(src.getCode());
        if (src.hasProfile())         tgt.setProfile(src.getProfile().get(0).getValue());
      }
      tgt.setTargetProfile(u.getValue());
    }
  }
 else {
    for (    org.hl7.fhir.r4.model.UriType u : src.getProfile()) {
      if (tgt.hasProfile()) {
        tgt=new org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent();
        list.add(tgt);
        copyElement(src,tgt);
        tgt.setCode(src.getCode());
      }
      tgt.setProfile(u.getValue());
    }
  }
}
Program: 23042
Project: 23042
Buggy source:
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  if (src.hasNameUrlType())   tgt.setSource(src.getNameUrlType().getValue());
  tgt.setName(src.getTitle());
  for (  org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  if (src.hasNameUrlType())   tgt.setSource(src.getNameUrlType().getValue());
  tgt.setName(src.getTitle());
  if (src.hasExtension(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE) && src.getExtensionString(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE).equals("String_Node_Str"))   tgt.setKind(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.PAGE);
  for (  org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}
Program: 23043
Project: 23043
Buggy source:
private static void copyElement(org.hl7.fhir.r4.model.Element src,org.hl7.fhir.dstu2016may.model.Element tgt) throws FHIRException {
  if (src.hasId())   tgt.setId(src.getId());
  for (  org.hl7.fhir.r4.model.Extension e : src.getExtension()) {
    tgt.addExtension(convertExtension(e));
  }
}

Fixed version (ground truth):
private static void copyElement(org.hl7.fhir.r4.model.Element src,org.hl7.fhir.dstu2016may.model.Element tgt) throws FHIRException {
  if (src.hasId())   tgt.setId(src.getId());
  for (  org.hl7.fhir.r4.model.Extension e : src.getExtension()) {
    if (!e.getUrl().equals(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE))     tgt.addExtension(convertExtension(e));
  }
}
Program: 23044
Project: 23044
Buggy source:
public static org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  if (src.hasNameUrlType())   tgt.setSource(src.getNameUrlType().getValue());
  tgt.setName(src.getTitle());
  for (  org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu2016may.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  if (src.hasNameUrlType())   tgt.setSource(src.getNameUrlType().getValue());
  tgt.setName(src.getTitle());
  if (src.hasExtension(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE) && src.getExtensionString(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE).equals("String_Node_Str"))   tgt.setKind(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.PAGE);
 else {
    tgt.setKind(org.hl7.fhir.dstu2016may.model.ImplementationGuide.GuidePageKind.RESOURCE);
  }
  for (  org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}
Program: 23045
Project: 23045
Buggy source:
public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  if (src.hasNameUrlType())   tgt.setSource(src.getNameUrlType().getValue());
  if (src.hasTitle())   tgt.setTitle(src.getTitle());
  for (  org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  if (src.hasNameUrlType())   tgt.setSource(src.getNameUrlType().getValue());
  if (src.hasTitle())   tgt.setTitle(src.getTitle());
  if (src.hasExtension(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE) && src.getExtensionString(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE).equals("String_Node_Str"))   tgt.setKind(org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind.PAGE);
  for (  org.hl7.fhir.r4.model.ImplementationGuide.ImplementationGuideDefinitionPageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}
Program: 23046
Project: 23046
Buggy source:
private static void copyElement(org.hl7.fhir.r4.model.Element src,org.hl7.fhir.dstu3.model.Element tgt) throws FHIRException {
  if (src.hasId())   tgt.setId(src.getId());
  for (  org.hl7.fhir.r4.model.Extension e : src.getExtension()) {
    tgt.addExtension(convertExtension(e));
  }
}

Fixed version (ground truth):
private static void copyElement(org.hl7.fhir.r4.model.Element src,org.hl7.fhir.dstu3.model.Element tgt) throws FHIRException {
  if (src.hasId())   tgt.setId(src.getId());
  for (  org.hl7.fhir.r4.model.Extension e : src.getExtension()) {
    if (!e.getUrl().equals(org.hl7.fhir.r4.utils.ToolingExtensions.EXT_GENERATED_PAGE))     tgt.addExtension(convertExtension(e));
  }
}
Program: 23048
Project: 23048
Buggy source:
public static org.hl7.fhir.dstu3.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu3.model.ParameterDefinition tgt=new org.hl7.fhir.dstu3.model.ParameterDefinition();
  copyElement(src,tgt);
  if (src.hasName())   tgt.setName(src.getName());
  if (src.hasUse())   tgt.setUse(convertParameterUse(src.getUse()));
  if (src.hasMin())   tgt.setMin(src.getMin());
  if (src.hasMax())   tgt.setMax(src.getMax());
  if (src.hasDocumentation())   tgt.setDocumentation(src.getDocumentation());
  if (src.hasType())   tgt.setType(src.getType());
  if (src.hasProfile())   tgt.setProfile(convertReference(src.getProfile()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu3.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r4.model.ParameterDefinition src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu3.model.ParameterDefinition tgt=new org.hl7.fhir.dstu3.model.ParameterDefinition();
  copyElement(src,tgt);
  if (src.hasName())   tgt.setName(src.getName());
  if (src.hasUse())   tgt.setUse(convertParameterUse(src.getUse()));
  if (src.hasMin())   tgt.setMin(src.getMin());
  if (src.hasMax())   tgt.setMax(src.getMax());
  if (src.hasDocumentation())   tgt.setDocumentation(src.getDocumentation());
  if (src.hasType())   tgt.setType(src.getType());
  if (src.hasProfile())   tgt.setProfile(new org.hl7.fhir.dstu3.model.Reference(src.getProfile()));
  return tgt;
}