Program: 23602
Project: 23602
Buggy source:
public org.hl7.fhir.dstu2.model.Immunization convertImmunization(org.hl7.fhir.dstu3.model.Immunization src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Immunization tgt=new org.hl7.fhir.dstu2.model.Immunization();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(src.getStatus().toCode());
  tgt.setDate(src.getDate());
  tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setWasNotGiven(src.getWasNotGiven());
  tgt.setReported(src.getReported());
  tgt.setPerformer(convertReference(src.getPerformer()));
  tgt.setRequester(convertReference(src.getRequester()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setManufacturer(convertReference(src.getManufacturer()));
  tgt.setLocation(convertReference(src.getLocation()));
  tgt.setLotNumber(src.getLotNumber());
  tgt.setExpirationDate(src.getExpirationDate());
  tgt.setSite(convertCodeableConcept(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.addNote(convertAnnotation(t));
  tgt.setExplanation(convertImmunizationExplanationComponent(src.getExplanation()));
  for (  org.hl7.fhir.dstu3.model.Immunization.ImmunizationReactionComponent t : src.getReaction())   tgt.addReaction(convertImmunizationReactionComponent(t));
  for (  org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent t : src.getVaccinationProtocol())   tgt.addVaccinationProtocol(convertImmunizationVaccinationProtocolComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Immunization convertImmunization(org.hl7.fhir.dstu3.model.Immunization src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Immunization tgt=new org.hl7.fhir.dstu2.model.Immunization();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(src.getStatus().toCode());
  tgt.setDate(src.getDate());
  tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setWasNotGiven(src.getWasNotGiven());
  tgt.setReported(src.getReported());
  tgt.setPerformer(convertReference(src.getPerformer()));
  tgt.setRequester(convertReference(src.getRequester()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setManufacturer(convertReference(src.getManufacturer()));
  tgt.setLocation(convertReference(src.getLocation()));
  tgt.setLotNumber(src.getLotNumber());
  tgt.setExpirationDate(src.getExpirationDate());
  tgt.setSite(convertCodeableConcept(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.addNote(convertAnnotation(t));
  tgt.setExplanation(convertImmunizationExplanationComponent(src.getExplanation()));
  for (  org.hl7.fhir.dstu3.model.Immunization.ImmunizationReactionComponent t : src.getReaction())   tgt.addReaction(convertImmunizationReactionComponent(t));
  for (  org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent t : src.getVaccinationProtocol())   tgt.addVaccinationProtocol(convertImmunizationVaccinationProtocolComponent(t));
  return tgt;
}