Program: 23341
Project: 23341
Buggy source:
public static org.hl7.fhir.dstu2016may.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2016may.model.ElementDefinition tgt=new org.hl7.fhir.dstu2016may.model.ElementDefinition();
  copyElement(src,tgt);
  tgt.setPath(src.getPath());
  for (  org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> t : src.getRepresentation())   tgt.addRepresentation(convertPropertyRepresentation(t.getValue()));
  if (src.hasSliceName())   tgt.setName(src.getSliceName());
  if (src.hasLabel())   tgt.setLabel(src.getLabel());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getCode())   tgt.addCode(convertCoding(t));
  tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
  if (src.hasShort())   tgt.setShort(src.getShort());
  if (src.hasDefinition())   tgt.setDefinition(src.getDefinition());
  if (src.hasComments())   tgt.setComments(src.getComments());
  if (src.hasRequirements())   tgt.setRequirements(src.getRequirements());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getAlias())   tgt.addAlias(t.getValue());
  if (src.hasMin())   tgt.setMin(src.getMin());
  if (src.hasMax())   tgt.setMax(src.getMax());
  tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
  if (src.hasContentReference())   tgt.setContentReference(src.getContentReference());
  for (  org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent t : src.getType())   tgt.addType(convertTypeRefComponent(t));
  tgt.setDefaultValue(convertType(src.getDefaultValue()));
  if (src.hasMeaningWhenMissing())   tgt.setMeaningWhenMissing(src.getMeaningWhenMissing());
  tgt.setFixed(convertType(src.getFixed()));
  tgt.setPattern(convertType(src.getPattern()));
  tgt.setExample(convertType(src.getExample()));
  tgt.setMinValue(convertType(src.getMinValue()));
  tgt.setMaxValue(convertType(src.getMaxValue()));
  if (src.hasMaxLength())   tgt.setMaxLength(src.getMaxLength());
  for (  org.hl7.fhir.dstu3.model.IdType t : src.getCondition())   tgt.addCondition(t.getValue());
  for (  org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())   tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
  if (src.hasMustSupport())   tgt.setMustSupport(src.getMustSupport());
  if (src.hasIsModifier())   tgt.setIsModifier(src.getIsModifier());
  if (src.hasIsSummary())   tgt.setIsSummary(src.getIsSummary());
  tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
  for (  org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())   tgt.addMapping(convertElementDefinitionMappingComponent(t));
  return tgt;
}

Fixed version (ground truth):
public static org.hl7.fhir.dstu2016may.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2016may.model.ElementDefinition tgt=new org.hl7.fhir.dstu2016may.model.ElementDefinition();
  copyElement(src,tgt);
  tgt.setPath(src.getPath());
  for (  org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> t : src.getRepresentation())   tgt.addRepresentation(convertPropertyRepresentation(t.getValue()));
  if (src.hasSliceName())   tgt.setName(src.getSliceName());
  if (src.hasLabel())   tgt.setLabel(src.getLabel());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getCode())   tgt.addCode(convertCoding(t));
  if (src.hasSlicing())   tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
  if (src.hasShort())   tgt.setShort(src.getShort());
  if (src.hasDefinition())   tgt.setDefinition(src.getDefinition());
  if (src.hasComments())   tgt.setComments(src.getComments());
  if (src.hasRequirements())   tgt.setRequirements(src.getRequirements());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getAlias())   tgt.addAlias(t.getValue());
  if (src.hasMin())   tgt.setMin(src.getMin());
  if (src.hasMax())   tgt.setMax(src.getMax());
  if (src.hasBase())   tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
  if (src.hasContentReference())   tgt.setContentReference(src.getContentReference());
  for (  org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent t : src.getType())   tgt.addType(convertTypeRefComponent(t));
  tgt.setDefaultValue(convertType(src.getDefaultValue()));
  if (src.hasMeaningWhenMissing())   tgt.setMeaningWhenMissing(src.getMeaningWhenMissing());
  tgt.setFixed(convertType(src.getFixed()));
  tgt.setPattern(convertType(src.getPattern()));
  tgt.setExample(convertType(src.getExample()));
  tgt.setMinValue(convertType(src.getMinValue()));
  tgt.setMaxValue(convertType(src.getMaxValue()));
  if (src.hasMaxLength())   tgt.setMaxLength(src.getMaxLength());
  for (  org.hl7.fhir.dstu3.model.IdType t : src.getCondition())   tgt.addCondition(t.getValue());
  for (  org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())   tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
  if (src.hasMustSupport())   tgt.setMustSupport(src.getMustSupport());
  if (src.hasIsModifier())   tgt.setIsModifier(src.getIsModifier());
  if (src.hasIsSummary())   tgt.setIsSummary(src.getIsSummary());
  if (src.hasBinding())   tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
  for (  org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())   tgt.addMapping(convertElementDefinitionMappingComponent(t));
  return tgt;
}