Program: 23858
Project: 23858
Buggy source:
public static org.hl7.fhir.dstu2016may.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu3.model.StructureDefinition src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2016may.model.StructureDefinition tgt=new org.hl7.fhir.dstu2016may.model.StructureDefinition();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setVersion(src.getVersion());
  tgt.setName(src.getName());
  tgt.setDisplay(src.getDisplay());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setExperimental(src.getExperimental());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact())   tgt.addContact(convertStructureDefinitionContactComponent(t));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCopyright(src.getCopyright());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getCode())   tgt.addCode(convertCoding(t));
  tgt.setFhirVersion(src.getFhirVersion());
  for (  org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping())   tgt.addMapping(convertStructureDefinitionMappingComponent(t));
  tgt.setKind(convertStructureDefinitionKind(src.getKind()));
  tgt.setAbstract(src.getAbstract());
  tgt.setContextType(convertExtensionContext(src.getContextType()));
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getContext())   tgt.addContext(t.getValue());
  tgt.setBaseType(src.getType());
  tgt.setBaseDefinition(src.getBaseDefinition());
  tgt.setDerivation(convertTypeDerivationRule(src.getDerivation()));
  tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot()));
  tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential()));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2016may.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu3.model.StructureDefinition src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2016may.model.StructureDefinition tgt=new org.hl7.fhir.dstu2016may.model.StructureDefinition();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setVersion(src.getVersion());
  tgt.setName(src.getName());
  tgt.setDisplay(src.getDisplay());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setExperimental(src.getExperimental());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact())   tgt.addContact(convertStructureDefinitionContactComponent(t));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCopyright(src.getCopyright());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getCode())   tgt.addCode(convertCoding(t));
  tgt.setFhirVersion(src.getFhirVersion());
  for (  org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping())   tgt.addMapping(convertStructureDefinitionMappingComponent(t));
  tgt.setKind(convertStructureDefinitionKind(src.getKind()));
  tgt.setAbstract(src.getAbstract());
  tgt.setContextType(convertExtensionContext(src.getContextType()));
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getContext())   tgt.addContext(t.getValue());
  tgt.setBaseType(src.getType());
  tgt.setBaseDefinition(src.getBaseDefinition());
  tgt.setDerivation(convertTypeDerivationRule(src.getDerivation()));
  tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot()));
  tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential()));
  return tgt;
}