nus-yam/ex-repair huggingface dataset:
Program: 24022
Project: 24022
Buggy source:
public static org.hl7.fhir.dstu2.model.DiagnosticOrder convertDiagnosticOrder(org.hl7.fhir.dstu3.model.DiagnosticOrder src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DiagnosticOrder tgt=new org.hl7.fhir.dstu2.model.DiagnosticOrder();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertDiagnosticOrderStatus(src.getStatus()));
  tgt.setPriority(convertDiagnosticOrderPriority(src.getPriority()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setOrderer(convertReference(src.getOrderer()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason())   tgt.addReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation())   tgt.addSupportingInformation(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen())   tgt.addSpecimen(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderEventComponent t : src.getEvent())   tgt.addEvent(convertDiagnosticOrderEventComponent(t));
  for (  org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderItemComponent t : src.getItem())   tgt.addItem(convertDiagnosticOrderItemComponent(t));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.addNote(convertAnnotation(t));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.DiagnosticOrder convertDiagnosticOrder(org.hl7.fhir.dstu3.model.DiagnosticOrder src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DiagnosticOrder tgt=new org.hl7.fhir.dstu2.model.DiagnosticOrder();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertDiagnosticOrderStatus(src.getStatus()));
  tgt.setPriority(convertDiagnosticOrderPriority(src.getPriority()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setOrderer(convertReference(src.getOrderer()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason())   tgt.addReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSupportingInformation())   tgt.addSupportingInformation(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderEventComponent t : src.getEvent())   tgt.addEvent(convertDiagnosticOrderEventComponent(t));
  for (  org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderItemComponent t : src.getItem())   tgt.addItem(convertDiagnosticOrderItemComponent(t));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.addNote(convertAnnotation(t));
  return tgt;
}
Program: 24024
Project: 24024
Buggy source:
public static org.hl7.fhir.dstu2.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.dstu3.model.EnrollmentResponse src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.EnrollmentResponse tgt=new org.hl7.fhir.dstu2.model.EnrollmentResponse();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setRequest(convertReference(src.getRequest()));
  tgt.setOutcome(convertRemittanceOutcome(src.getOutcome()));
  tgt.setDisposition(src.getDisposition());
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  tgt.setOrganization(convertReference(src.getOrganization()));
  tgt.setRequestProvider(convertReference(src.getRequestProvider()));
  tgt.setRequestOrganization(convertReference(src.getRequestOrganization()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.dstu3.model.EnrollmentResponse src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.EnrollmentResponse tgt=new org.hl7.fhir.dstu2.model.EnrollmentResponse();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setRequest(convertReference(src.getRequest()));
  tgt.setDisposition(src.getDisposition());
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  tgt.setOrganization(convertReference(src.getOrganization()));
  tgt.setRequestProvider(convertReference(src.getRequestProvider()));
  tgt.setRequestOrganization(convertReference(src.getRequestOrganization()));
  return tgt;
}
Program: 24025
Project: 24025
Buggy source:
public static org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent tgt=new org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent();
  copyElement(src,tgt);
  tgt.setLow(convertSimpleQuantity(src.getLow()));
  tgt.setHigh(convertSimpleQuantity(src.getHigh()));
  tgt.setMeaning(convertCodeableConcept(src.getMeaning()));
  tgt.setAge(convertRange(src.getAge()));
  tgt.setText(src.getText());
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent convertObservationReferenceRangeComponent(org.hl7.fhir.dstu3.model.Observation.ObservationReferenceRangeComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent tgt=new org.hl7.fhir.dstu2.model.Observation.ObservationReferenceRangeComponent();
  copyElement(src,tgt);
  tgt.setLow(convertSimpleQuantity(src.getLow()));
  tgt.setHigh(convertSimpleQuantity(src.getHigh()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept c : src.getMeaning())   tgt.setMeaning(convertCodeableConcept(c));
  tgt.setAge(convertRange(src.getAge()));
  tgt.setText(src.getText());
  return tgt;
}
Program: 24026
Project: 24026
Buggy source:
public static org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent tgt=new org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent();
  copyElement(src,tgt);
  tgt.setQuantity(convertRatio(src.getQuantity()));
  tgt.setSubstance(convertReference(src.getSubstance()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent tgt=new org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent();
  copyElement(src,tgt);
  tgt.setQuantity(convertRatio(src.getQuantity()));
  return tgt;
}
Program: 24027
Project: 24027
Buggy source:
public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent convertMedicationDispenseDosageInstructionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseDosageInstructionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setAdditionalInstructions(convertCodeableConcept(src.getAdditionalInstructions()));
  tgt.setTiming(convertTiming(src.getTiming()));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setDose(convertType(src.getDose()));
  tgt.setRate(convertType(src.getRate()));
  tgt.setMaxDosePerPeriod(convertRatio(src.getMaxDosePerPeriod()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent convertMedicationDispenseDosageInstructionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseDosageInstructionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setTiming(convertTiming(src.getTiming()));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setDose(convertType(src.getDose()));
  tgt.setRate(convertType(src.getRate()));
  tgt.setMaxDosePerPeriod(convertRatio(src.getMaxDosePerPeriod()));
  return tgt;
}
Program: 24028
Project: 24028
Buggy source:
public static org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.dstu3.model.Specimen.SpecimenCollectionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent tgt=new org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent();
  copyElement(src,tgt);
  tgt.setCollector(convertReference(src.getCollector()));
  tgt.addComment(src.getComment());
  tgt.setCollected(convertType(src.getCollected()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.dstu3.model.Specimen.SpecimenCollectionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent tgt=new org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent();
  copyElement(src,tgt);
  tgt.setCollector(convertReference(src.getCollector()));
  tgt.setCollected(convertType(src.getCollected()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
  return tgt;
}
Program: 24030
Project: 24030
Buggy source:
public static org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt=new org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setRate(convertType(src.getRate()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt=new org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setRate(convertType(src.getRate()));
  return tgt;
}
Program: 24032
Project: 24032
Buggy source:
public static org.hl7.fhir.dstu2.model.Condition convertCondition(org.hl7.fhir.dstu3.model.Condition src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Condition tgt=new org.hl7.fhir.dstu2.model.Condition();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setAsserter(convertReference(src.getAsserter()));
  tgt.setDateRecorded(src.getDateRecorded());
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setClinicalStatus(src.getClinicalStatus());
  tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus()));
  tgt.setSeverity(convertCodeableConcept(src.getSeverity()));
  tgt.setOnset(convertType(src.getOnset()));
  tgt.setAbatement(convertType(src.getAbatement()));
  tgt.setStage(convertConditionStageComponent(src.getStage()));
  for (  org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence())   tgt.addEvidence(convertConditionEvidenceComponent(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite())   tgt.addBodySite(convertCodeableConcept(t));
  tgt.setNotes(src.getNotes());
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.Condition convertCondition(org.hl7.fhir.dstu3.model.Condition src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Condition tgt=new org.hl7.fhir.dstu2.model.Condition();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setAsserter(convertReference(src.getAsserter()));
  tgt.setDateRecorded(src.getDateRecorded());
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setClinicalStatus(src.getClinicalStatus());
  tgt.setVerificationStatus(convertConditionVerificationStatus(src.getVerificationStatus()));
  tgt.setSeverity(convertCodeableConcept(src.getSeverity()));
  tgt.setOnset(convertType(src.getOnset()));
  tgt.setAbatement(convertType(src.getAbatement()));
  tgt.setStage(convertConditionStageComponent(src.getStage()));
  for (  org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence())   tgt.addEvidence(convertConditionEvidenceComponent(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite())   tgt.addBodySite(convertCodeableConcept(t));
  return tgt;
}
Program: 24033
Project: 24033
Buggy source:
public static org.hl7.fhir.dstu2.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.dstu3.model.MedicationAdministration src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationAdministration tgt=new org.hl7.fhir.dstu2.model.MedicationAdministration();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertMedicationAdministrationStatus(src.getStatus()));
  tgt.setMedication(convertType(src.getMedication()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setEffectiveTime(convertType(src.getEffectiveTime()));
  tgt.setPractitioner(convertReference(src.getPractitioner()));
  tgt.setPrescription(convertReference(src.getPrescription()));
  tgt.setWasNotGiven(src.getWasNotGiven());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonNotGiven())   tgt.addReasonNotGiven(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonGiven())   tgt.addReasonGiven(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getDevice())   tgt.addDevice(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(t.getText());
  tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.dstu3.model.MedicationAdministration src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationAdministration tgt=new org.hl7.fhir.dstu2.model.MedicationAdministration();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertMedicationAdministrationStatus(src.getStatus()));
  tgt.setMedication(convertType(src.getMedication()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setEffectiveTime(convertType(src.getEffectiveTime()));
  tgt.setPrescription(convertReference(src.getPrescription()));
  tgt.setWasNotGiven(src.getWasNotGiven());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonNotGiven())   tgt.addReasonNotGiven(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonGiven())   tgt.addReasonGiven(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getDevice())   tgt.addDevice(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(t.getText());
  tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage()));
  return tgt;
}
Program: 24034
Project: 24034
Buggy source:
public static org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDosageInstructionComponent convertMedicationOrderDosageInstructionComponent(org.hl7.fhir.dstu3.model.MedicationOrder.MedicationOrderDosageInstructionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDosageInstructionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDosageInstructionComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setAdditionalInstructions(convertCodeableConcept(src.getAdditionalInstructions()));
  tgt.setTiming(convertTiming(src.getTiming()));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setDose(convertType(src.getDose()));
  tgt.setRate(convertType(src.getRate()));
  tgt.setMaxDosePerPeriod(convertRatio(src.getMaxDosePerPeriod()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDosageInstructionComponent convertMedicationOrderDosageInstructionComponent(org.hl7.fhir.dstu3.model.MedicationOrder.MedicationOrderDosageInstructionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDosageInstructionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDosageInstructionComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setTiming(convertTiming(src.getTiming()));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setDose(convertType(src.getDose()));
  tgt.setRate(convertType(src.getRate()));
  tgt.setMaxDosePerPeriod(convertRatio(src.getMaxDosePerPeriod()));
  return tgt;
}
Program: 24036
Project: 24036
Buggy source:
public static org.hl7.fhir.dstu2.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.dstu3.model.SupplyDelivery src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.SupplyDelivery tgt=new org.hl7.fhir.dstu2.model.SupplyDelivery();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setSuppliedItem(convertReference(src.getSuppliedItem()));
  tgt.setSupplier(convertReference(src.getSupplier()));
  tgt.setWhenPrepared(convertPeriod(src.getWhenPrepared()));
  tgt.setTime(src.getTime());
  tgt.setDestination(convertReference(src.getDestination()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReceiver())   tgt.addReceiver(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.dstu3.model.SupplyDelivery src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.SupplyDelivery tgt=new org.hl7.fhir.dstu2.model.SupplyDelivery();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setSupplier(convertReference(src.getSupplier()));
  tgt.setWhenPrepared(convertPeriod(src.getWhenPrepared()));
  tgt.setTime(src.getTime());
  tgt.setDestination(convertReference(src.getDestination()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReceiver())   tgt.addReceiver(convertReference(t));
  return tgt;
}
Program: 24037
Project: 24037
Buggy source:
public static org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDispenseRequestComponent convertMedicationOrderDispenseRequestComponent(org.hl7.fhir.dstu3.model.MedicationOrder.MedicationOrderDispenseRequestComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDispenseRequestComponent tgt=new org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDispenseRequestComponent();
  copyElement(src,tgt);
  tgt.setMedication(convertType(src.getMedication()));
  tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
  tgt.setNumberOfRepeatsAllowed(src.getNumberOfRepeatsAllowed());
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDispenseRequestComponent convertMedicationOrderDispenseRequestComponent(org.hl7.fhir.dstu3.model.MedicationOrder.MedicationOrderDispenseRequestComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDispenseRequestComponent tgt=new org.hl7.fhir.dstu2.model.MedicationOrder.MedicationOrderDispenseRequestComponent();
  copyElement(src,tgt);
  tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
  tgt.setNumberOfRepeatsAllowed(src.getNumberOfRepeatsAllowed());
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration()));
  return tgt;
}
Program: 24038
Project: 24038
Buggy source:
public static org.hl7.fhir.dstu2.model.DiagnosticOrder.DiagnosticOrderItemComponent convertDiagnosticOrderItemComponent(org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderItemComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DiagnosticOrder.DiagnosticOrderItemComponent tgt=new org.hl7.fhir.dstu2.model.DiagnosticOrder.DiagnosticOrderItemComponent();
  copyElement(src,tgt);
  tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen())   tgt.addSpecimen(convertReference(t));
  tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
  tgt.setStatus(convertDiagnosticOrderStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderEventComponent t : src.getEvent())   tgt.addEvent(convertDiagnosticOrderEventComponent(t));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2.model.DiagnosticOrder.DiagnosticOrderItemComponent convertDiagnosticOrderItemComponent(org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderItemComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DiagnosticOrder.DiagnosticOrderItemComponent tgt=new org.hl7.fhir.dstu2.model.DiagnosticOrder.DiagnosticOrderItemComponent();
  copyElement(src,tgt);
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
  tgt.setStatus(convertDiagnosticOrderStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.DiagnosticOrder.DiagnosticOrderEventComponent t : src.getEvent())   tgt.addEvent(convertDiagnosticOrderEventComponent(t));
  return tgt;
}
Program: 24039
Project: 24039
Buggy source:
private void validate(String path,int errorCount,boolean json) throws Exception {
  if (json)   return;
  if (TestingUtilities.context == null) {
    TestingUtilities.context=SimpleWorkerContext.fromPack("String_Node_Str");
    ((SimpleWorkerContext)TestingUtilities.context).connectToTSServer("String_Node_Str");
  }
  System.out.print("String_Node_Str" + path + "String_Node_Str"+ Integer.toString(errorCount)+ (errorCount == 0 ? "String_Node_Str" : "String_Node_Str"));
  FileInputStream file=new FileInputStream(Utilities.path("String_Node_Str",path));
  InstanceValidator val=new InstanceValidator(TestingUtilities.context);
  List<ValidationMessage> errors=new ArrayList<ValidationMessage>();
  val.validate(errors,file,json ? FhirFormat.JSON : FhirFormat.XML);
  int ec=0;
  boolean first=true;
  for (  ValidationMessage m : errors) {
    if (m.getLevel() == IssueSeverity.ERROR || m.getLevel() == IssueSeverity.FATAL) {
      ec++;
      if (first) {
        first=false;
        System.out.print("String_Node_Str");
      }
 else       System.out.print("String_Node_Str");
      System.out.print("String_Node_Str" + Utilities.escapeJson(m.getMessage()) + "String_Node_Str");
    }
  }
  System.out.println(errorCount == 0 ? "String_Node_Str" : first ? "String_Node_Str" : "String_Node_Str");
  Assert.assertTrue(ec == errorCount);
}

Fixed version (ground truth):
private void validate(String path,int errorCount,boolean json) throws Exception {
  if (TestingUtilities.context == null) {
    TestingUtilities.context=SimpleWorkerContext.fromPack("String_Node_Str");
    ((SimpleWorkerContext)TestingUtilities.context).connectToTSServer("String_Node_Str");
  }
  System.out.println("String_Node_Str" + path);
  FileInputStream file=new FileInputStream(Utilities.path("String_Node_Str",path));
  InstanceValidator val=new InstanceValidator(TestingUtilities.context);
  List<ValidationMessage> errors=new ArrayList<ValidationMessage>();
  val.validate(errors,file,json ? FhirFormat.JSON : FhirFormat.XML);
  int ec=0;
  for (  ValidationMessage m : errors) {
    if (m.getLevel() == IssueSeverity.ERROR || m.getLevel() == IssueSeverity.FATAL) {
      ec++;
      System.out.println("String_Node_Str" + m.summary());
    }
  }
  Assert.assertTrue(ec == errorCount);
  System.out.println(val.reportTimes());
}
Program: 24040
Project: 24040
Buggy source:
private void validateContains(List<ValidationMessage> errors,String path,ElementDefinition child,ElementDefinition context,Element resource,Element element,NodeStack stack,IdStatus idstatus) throws FHIRException, FHIRException {
  String resourceName=element.getType();
  long t=System.nanoTime();
  StructureDefinition profile=this.context.fetchResource(StructureDefinition.class,"String_Node_Str" + resourceName);
  sdTime=sdTime + (System.nanoTime() - t);
  if (element.getSpecial() == SpecialElement.BUNDLE_ENTRY)   resource=element;
  if (rule(errors,IssueType.INVALID,element.line(),element.col(),stack.getLiteralPath(),profile != null,"String_Node_Str" + resourceName + "String_Node_Str"))   validateResource(errors,resource,element,profile,idstatus,stack);
}

Fixed version (ground truth):
private void validateContains(List<ValidationMessage> errors,String path,ElementDefinition child,ElementDefinition context,Element resource,Element element,NodeStack stack,IdStatus idstatus) throws FHIRException, FHIRException {
  String resourceName=element.getType();
  long t=System.nanoTime();
  StructureDefinition profile=this.context.fetchResource(StructureDefinition.class,"String_Node_Str" + resourceName);
  sdTime=sdTime + (System.nanoTime() - t);
  if (element.getSpecial() == SpecialElement.BUNDLE_ENTRY || element.getSpecial() == SpecialElement.PARAMETER)   resource=element;
  if (rule(errors,IssueType.INVALID,element.line(),element.col(),stack.getLiteralPath(),profile != null,"String_Node_Str" + resourceName + "String_Node_Str"))   validateResource(errors,resource,element,profile,idstatus,stack);
}
Program: 24042
Project: 24042
Buggy source:
private void generateEnum(BindingSpecification bs) throws IOException {
  String en=bs.getValueSet().getName();
  if (genEnums.contains(en))   return;
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  ValueSet ex=workerContext.expandVS(bs.getValueSet(),true).getValueset();
  for (  ValueSetExpansionContainsComponent cc : ex.getExpansion().getContains()) {
    genIncludedCode(cc);
  }
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + Utilities.escapeXml(enumDefs.get(en)) + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  genEnums.add(en);
}

Fixed version (ground truth):
private void generateEnum(BindingSpecification bs) throws IOException {
  String en=bs.getValueSet().getName();
  if (genEnums.contains(en))   return;
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  bs.getValueSet().setUserData(ToolResourceUtilities.NAME_VS_USE_MARKER,true);
  ValueSet ex=workerContext.expandVS(bs.getValueSet(),true).getValueset();
  for (  ValueSetExpansionContainsComponent cc : ex.getExpansion().getContains()) {
    genIncludedCode(cc);
  }
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + Utilities.escapeXml(enumDefs.get(en)) + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  genEnums.add(en);
}
Program: 24043
Project: 24043
Buggy source:
private void generateEnum(String en) throws IOException {
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  ValueSet vs=enums.get(en);
  ValueSet ex=workerContext.expandVS(vs,true).getValueset();
  for (  ValueSetExpansionContainsComponent cc : ex.getExpansion().getContains()) {
    genIncludedCode(cc);
  }
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + Utilities.escapeXml(enumDefs.get(en)) + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
}

Fixed version (ground truth):
private void generateEnum(String en) throws IOException {
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  ValueSet vs=enums.get(en);
  vs.setUserData(ToolResourceUtilities.NAME_VS_USE_MARKER,true);
  ValueSet ex=workerContext.expandVS(vs,true).getValueset();
  for (  ValueSetExpansionContainsComponent cc : ex.getExpansion().getContains()) {
    genIncludedCode(cc);
  }
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + Utilities.escapeXml(enumDefs.get(en)) + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str" + en + "String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
  write("String_Node_Str");
}
Program: 24045
Project: 24045
Buggy source:
private String genTypeRef(ElementDefinition.TypeRefComponent typ){
  if (typ.getProfile().size() > 0) {
    if (typ.getProfile().size() != 1)     throw new AssertionError("String_Node_Str");
    if (typ.getCode().equals("String_Node_Str"))     return genReference("String_Node_Str",typ).render();
 else     return tmplt(SIMPLE_ELEMENT_TEMPLATE).add("String_Node_Str",getProfiledType(typ)).render();
  }
 else   if (typ.getCodeElement().getExtensionsByUrl(XML_DEFN_TYPE).size() > 0) {
    String xt=null;
    try {
      xt=typ.getCodeElement().getExtensionString(XML_DEFN_TYPE);
    }
 catch (    FHIRException e) {
      e.printStackTrace();
    }
    xt=xt.replace("String_Node_Str","String_Node_Str");
    if (!xt.contains("String_Node_Str"))     xt="String_Node_Str" + xt;
    return tmplt(PRIMITIVE_ELEMENT_TEMPLATE).add("String_Node_Str",xt.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str")).render();
  }
 else   if (typ.getCode() == null) {
    ST primitive_entry=tmplt(PRIMITIVE_ELEMENT_TEMPLATE);
    primitive_entry.add("String_Node_Str","String_Node_Str");
    return primitive_entry.render();
  }
 else   if (typ.getCode().equals("String_Node_Str")) {
    return tmplt(XHTML_TEMPLATE).render();
  }
 else {
    datatypes.add(typ.getCode());
    return tmplt(SIMPLE_ELEMENT_TEMPLATE).add("String_Node_Str",typ.getCode()).render();
  }
}

Fixed version (ground truth):
private String genTypeRef(ElementDefinition.TypeRefComponent typ){
  if (typ.getProfile().size() > 0) {
    if (typ.getProfile().size() != 1)     throw new AssertionError("String_Node_Str");
    if (typ.getCode().equals("String_Node_Str"))     return genReference("String_Node_Str",typ).render();
 else     return tmplt(SIMPLE_ELEMENT_TEMPLATE).add("String_Node_Str",getProfiledType(typ)).render();
  }
 else   if (typ.getCodeElement().getExtensionsByUrl(XML_DEFN_TYPE).size() > 0) {
    String xt=null;
    try {
      xt=typ.getCodeElement().getExtensionString(XML_DEFN_TYPE);
    }
 catch (    FHIRException e) {
      e.printStackTrace();
    }
    xt=xt.replace("String_Node_Str","String_Node_Str");
    if (!xt.contains("String_Node_Str"))     xt="String_Node_Str" + xt;
    return tmplt(PRIMITIVE_ELEMENT_TEMPLATE).add("String_Node_Str",xt.replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str")).render();
  }
 else   if (typ.getCode() == null) {
    ST primitive_entry=tmplt(PRIMITIVE_ELEMENT_TEMPLATE);
    primitive_entry.add("String_Node_Str","String_Node_Str");
    return primitive_entry.render();
  }
 else   if (typ.getCode().equals("String_Node_Str")) {
    return tmplt(XHTML_TEMPLATE).render();
  }
 else {
    datatypes.add(typ.getCode());
    return tmplt(SIMPLE_ELEMENT_TEMPLATE).add("String_Node_Str",typ.getCode()).render();
  }
}
Program: 24046
Project: 24046
Buggy source:
/** 
 * Generate a ShEx element definition
 * @param sd Containing structure definition
 * @param ed Containing element definition
 * @return ShEx definition
 */
private String genElementDefinition(StructureDefinition sd,ElementDefinition ed){
  ST element_def=tmplt(ELEMENT_TEMPLATE);
  String id=ed.hasBase() ? ed.getBase().getPath() : ed.getPath();
  String shortId=id.substring(id.lastIndexOf("String_Node_Str") + 1);
  String card="String_Node_Str".equals(ed.getMax()) ? (ed.getMin() == 0 ? "String_Node_Str" : "String_Node_Str") : "String_Node_Str";
  String defn;
  element_def.add("String_Node_Str",id.charAt(0) == id.toLowerCase().charAt(0) ? shortId : id);
  element_def.add("String_Node_Str",card);
  List<ElementDefinition> children=ProfileUtilities.getChildList(sd,ed);
  if (children.size() > 0) {
    innerTypes.add(new ImmutablePair<StructureDefinition,ElementDefinition>(sd,ed));
    ST anon_link=tmplt(SIMPLE_ELEMENT_TEMPLATE);
    anon_link.add("String_Node_Str",id);
    defn=anon_link.render();
  }
 else   if (ed.getType().size() == 1) {
    defn=genTypeRef(ed.getType().get(0));
  }
 else {
    if (id.endsWith("String_Node_Str")) {
      return genChoiceTypes(ed,id,shortId,card);
    }
 else {
      defn=genAlternativeTypes(ed,id,shortId,card);
    }
  }
  element_def.add("String_Node_Str",defn);
  return element_def.render();
}

Fixed version (ground truth):
/** 
 * Generate a ShEx element definition
 * @param sd Containing structure definition
 * @param ed Containing element definition
 * @return ShEx definition
 */
private String genElementDefinition(StructureDefinition sd,ElementDefinition ed){
  ST element_def=tmplt(ELEMENT_TEMPLATE);
  String id=ed.hasBase() ? ed.getBase().getPath() : ed.getPath();
  String shortId=id.substring(id.lastIndexOf("String_Node_Str") + 1);
  String card="String_Node_Str".equals(ed.getMax()) ? (ed.getMin() == 0 ? "String_Node_Str" : "String_Node_Str") : "String_Node_Str";
  String defn;
  element_def.add("String_Node_Str",id.charAt(0) == id.toLowerCase().charAt(0) ? shortId : id);
  element_def.add("String_Node_Str",card);
  List<ElementDefinition> children=ProfileUtilities.getChildList(sd,ed);
  if (children.size() > 0) {
    innerTypes.add(new ImmutablePair<StructureDefinition,ElementDefinition>(sd,ed));
    ST anon_link=tmplt(SIMPLE_ELEMENT_TEMPLATE);
    anon_link.add("String_Node_Str",id);
    defn=anon_link.render();
  }
 else   if (ed.getType().size() == 1) {
    defn=genTypeRef(ed.getType().get(0));
  }
 else   if (ed.getContentReference() != null) {
    String typ=id.substring(0,id.indexOf("String_Node_Str") + 1) + ed.getContentReference().substring(1);
    ST defn_ref=tmplt(SIMPLE_ELEMENT_TEMPLATE);
    defn_ref.add("String_Node_Str",typ);
    defn=defn_ref.render();
  }
 else {
    if (id.endsWith("String_Node_Str")) {
      return genChoiceTypes(ed,id,shortId,card);
    }
 else {
      defn=genAlternativeTypes(ed,id,shortId,card);
    }
  }
  element_def.add("String_Node_Str",defn);
  return element_def.render();
}
Program: 24048
Project: 24048
Buggy source:
public void getNamedChildrenWithWildcard(String string,List<Element> values){
  throw new Error("String_Node_Str");
}

Fixed version (ground truth):
public void getNamedChildrenWithWildcard(String string,List<Element> values){
  Validate.isTrue(string.endsWith("String_Node_Str"));
  String start=string.substring(0,string.length() - 3);
  if (children != null) {
    for (    Element child : children) {
      if (child.getName().startsWith(start)) {
        values.add(child);
      }
    }
  }
}
Program: 24049
Project: 24049
Buggy source:
protected StructureDefinition getDefinition(int line,int col,String name) throws FHIRFormatError {
  if (name == null) {
    logError(line,col,name,IssueType.STRUCTURE,"String_Node_Str",IssueSeverity.FATAL);
    return null;
  }
  for (  StructureDefinition sd : context.allStructures()) {
    if (name.equals(sd.getId())) {
      return sd;
    }
  }
  logError(line,col,name,IssueType.STRUCTURE,"String_Node_Str" + name + "String_Node_Str",IssueSeverity.FATAL);
  return null;
}

Fixed version (ground truth):
protected StructureDefinition getDefinition(int line,int col,String name) throws FHIRFormatError {
  if (name == null) {
    logError(line,col,name,IssueType.STRUCTURE,"String_Node_Str",IssueSeverity.FATAL);
    return null;
  }
  for (  StructureDefinition sd : context.allStructures()) {
    if (name.equals(sd.getIdElement().getIdPart())) {
      return sd;
    }
  }
  logError(line,col,name,IssueType.STRUCTURE,"String_Node_Str" + name + "String_Node_Str",IssueSeverity.FATAL);
  return null;
}
Program: 24050
Project: 24050
Buggy source:
public boolean equalsDeep(Base other){
  return other == this;
}

Fixed version (ground truth):
public boolean equalsDeep(Base other){
  return other != null;
}
Program: 24051
Project: 24051
Buggy source:
public static boolean compareValues(PrimitiveType e1,PrimitiveType e2,boolean allowNull){
  if (e1 == null && e2 == null && allowNull)   return true;
  if (e1 == null || e2 == null)   return false;
  return e1.equalsShallow(e2);
}

Fixed version (ground truth):
public static boolean compareValues(PrimitiveType e1,PrimitiveType e2,boolean allowNull){
  boolean noLeft=e1 == null || e1.isEmpty();
  boolean noRight=e2 == null || e2.isEmpty();
  if (noLeft && noRight && allowNull) {
    return true;
  }
  if (noLeft != noRight)   return false;
  return e1.equalsShallow(e2);
}
Program: 24052
Project: 24052
Buggy source:
public boolean equalsShallow(Base other){
  return other == this;
}

Fixed version (ground truth):
public boolean equalsShallow(Base other){
  return other != null;
}
Program: 24053
Project: 24053
Buggy source:
public boolean hasType(String... name){
  String t=fhirType();
  for (  String n : name)   if (n.equals(t))   return true;
  return false;
}

Fixed version (ground truth):
public boolean hasType(String... name){
  String t=fhirType();
  for (  String n : name)   if (n.equalsIgnoreCase(t))   return true;
  return false;
}
Program: 24054
Project: 24054
Buggy source:
private void generateCodeSystemsPart2() throws Exception {
  Set<String> urls=new HashSet<String>();
  for (  CodeSystem cs : page.getDefinitions().getCodeSystems().values()) {
    if (cs.getUserData("String_Node_Str") == null && !cs.getUrl().contains("String_Node_Str") && !cs.getUrl().contains("String_Node_Str"))     if (!urls.contains(cs.getUrl())) {
      urls.add(cs.getUrl());
      generateCodeSystemPart2(cs);
    }
  }
}

Fixed version (ground truth):
private void generateCodeSystemsPart2() throws Exception {
  Set<String> urls=new HashSet<String>();
  for (  CodeSystem cs : page.getDefinitions().getCodeSystems().values()) {
    if (cs != null) {
      if (cs.getUserData("String_Node_Str") == null && !cs.getUrl().contains("String_Node_Str") && !cs.getUrl().contains("String_Node_Str"))       if (!urls.contains(cs.getUrl())) {
        urls.add(cs.getUrl());
        generateCodeSystemPart2(cs);
      }
    }
  }
}
Program: 24055
Project: 24055
Buggy source:
private void checkStringOption(List<ValidationMessage> errors,WrapperElement answer,NodeStack stack,Questionnaire qSrc,QuestionnaireItemComponent qItem,boolean openChoice){
  WrapperElement v=answer.getNamedChild("String_Node_Str");
  NodeStack ns=stack.push(v,-1,null,null);
  if (qItem.getOption().size() > 0) {
    List<StringType> list=new ArrayList<StringType>();
    for (    QuestionnaireItemOptionComponent components : qItem.getOption()) {
      try {
        list.add(components.getValueStringType());
      }
 catch (      FHIRException e) {
      }
    }
    if (list.isEmpty() && !openChoice) {
      rule(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),false,"String_Node_Str");
    }
 else {
      boolean found=false;
      for (      StringType item : list) {
        if (item.getValue().equals((v.getAttribute("String_Node_Str")))) {
          found=true;
          break;
        }
      }
      if (!found) {
        rule(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),found,"String_Node_Str" + v.getAttribute("String_Node_Str") + "String_Node_Str");
      }
    }
  }
 else   hint(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),false,"String_Node_Str");
}

Fixed version (ground truth):
private void checkStringOption(List<ValidationMessage> errors,WrapperElement answer,NodeStack stack,Questionnaire qSrc,QuestionnaireItemComponent qItem,boolean openChoice){
  WrapperElement v=answer.getNamedChild("String_Node_Str");
  NodeStack ns=stack.push(v,-1,null,null);
  if (qItem.getOption().size() > 0) {
    List<StringType> list=new ArrayList<StringType>();
    for (    QuestionnaireItemOptionComponent components : qItem.getOption()) {
      try {
        list.add(components.getValueStringType());
      }
 catch (      FHIRException e) {
      }
    }
    if (list.isEmpty() && !openChoice) {
      rule(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),false,"String_Node_Str");
    }
 else {
      boolean found=false;
      for (      StringType item : list) {
        if (item.getValue().equals((v.getAttribute("String_Node_Str")))) {
          found=true;
          break;
        }
      }
      if (!found) {
        rule(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),found,"String_Node_Str" + v.getAttribute("String_Node_Str") + "String_Node_Str");
      }
    }
  }
 else {
    hint(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),false,"String_Node_Str");
  }
}
Program: 24056
Project: 24056
Buggy source:
private void validateAnswerCode(List<ValidationMessage> errors,WrapperElement answer,NodeStack stack,Questionnaire qSrc,QuestionnaireItemComponent qItem){
  WrapperElement v=answer.getNamedChild("String_Node_Str");
  NodeStack ns=stack.push(v,-1,null,null);
  if (qItem.getOption().size() > 0)   checkCodingOption(errors,answer,stack,qSrc,qItem,false);
 else   if (qItem.hasOptions())   validateAnswerCode(errors,v,stack,qSrc,qItem.getOptions());
 else   hint(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),false,"String_Node_Str");
}

Fixed version (ground truth):
private void validateAnswerCode(List<ValidationMessage> errors,WrapperElement answer,NodeStack stack,Questionnaire qSrc,QuestionnaireItemComponent qItem,boolean theOpenChoice){
  WrapperElement v=answer.getNamedChild("String_Node_Str");
  NodeStack ns=stack.push(v,-1,null,null);
  if (qItem.getOption().size() > 0)   checkCodingOption(errors,answer,stack,qSrc,qItem,theOpenChoice);
 else   if (qItem.hasOptions())   validateAnswerCode(errors,v,stack,qSrc,qItem.getOptions(),theOpenChoice);
 else   hint(errors,IssueType.STRUCTURE,v.line(),v.col(),stack.getLiteralPath(),false,"String_Node_Str");
}