Program: 23526
Project: 23526
Buggy source:
public org.hl7.fhir.dstu2.model.Contract convertContract(org.hl7.fhir.dstu3.model.Contract src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Contract tgt=new org.hl7.fhir.dstu2.model.Contract();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setIssued(src.getIssued());
  tgt.setApplies(convertPeriod(src.getApplies()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSubject())   tgt.addSubject(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAuthority())   tgt.addAuthority(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getDomain())   tgt.addDomain(convertReference(t));
  tgt.setType(convertCodeableConcept(src.getType()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType())   tgt.addSubType(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction())   tgt.addAction(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason())   tgt.addActionReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent())   tgt.addActor(convertAgentComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner())   tgt.addSigner(convertSignatoryComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem())   tgt.addValuedItem(convertValuedItemComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm())   tgt.addTerm(convertTermComponent(t));
  tgt.setBinding(convertType(src.getBinding()));
  for (  org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly())   tgt.addFriendly(convertFriendlyLanguageComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal())   tgt.addLegal(convertLegalLanguageComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule())   tgt.addRule(convertComputableLanguageComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Contract convertContract(org.hl7.fhir.dstu3.model.Contract src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Contract tgt=new org.hl7.fhir.dstu2.model.Contract();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setIssued(src.getIssued());
  tgt.setApplies(convertPeriod(src.getApplies()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSubject())   tgt.addSubject(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAuthority())   tgt.addAuthority(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getDomain())   tgt.addDomain(convertReference(t));
  tgt.setType(convertCodeableConcept(src.getType()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType())   tgt.addSubType(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction())   tgt.addAction(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason())   tgt.addActionReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent())   tgt.addActor(convertAgentComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner())   tgt.addSigner(convertSignatoryComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem())   tgt.addValuedItem(convertValuedItemComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm())   tgt.addTerm(convertTermComponent(t));
  tgt.setBinding(convertType(src.getBinding()));
  for (  org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly())   tgt.addFriendly(convertFriendlyLanguageComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal())   tgt.addLegal(convertLegalLanguageComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule())   tgt.addRule(convertComputableLanguageComponent(t));
  return tgt;
}