Program: 67621
Project: 67621
Buggy source:
public XMLMapping generateCollectionMappingForReferenceProperty(ReferenceProperty property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLChoiceCollectionMapping mapping=new XMLChoiceCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  List<ElementDeclaration> referencedElements=property.getReferencedElements();
  boolean hasJAXBElements=false;
  AttributeAccessor mappingAccessor=mapping.getAttributeAccessor();
  Map<QName,Class> qNamesToScopeClass=new HashMap<QName,Class>();
  for (  ElementDeclaration element : referencedElements) {
    QName elementName=element.getElementName();
    XMLField xmlField=this.getXPathForElement("String_Node_Str",elementName,namespaceInfo,!(this.typeInfo.containsKey(element.getJavaTypeName())));
    mapping.addChoiceElement(xmlField,element.getJavaTypeName());
    if (!element.isXmlRootElement()) {
      XMLRootConverter converter=new XMLRootConverter(xmlField);
      mapping.addConverter(xmlField,converter);
      qNamesToScopeClass.put(elementName,element.getScopeClass());
    }
    hasJAXBElements=hasJAXBElements || !element.isXmlRootElement();
  }
  if (hasJAXBElements) {
    JAXBElementAttributeAccessor accessor=new JAXBElementAttributeAccessor(mappingAccessor,mapping.getContainerPolicy());
    accessor.setQNamesToScopes(qNamesToScopeClass);
    mapping.setAttributeAccessor(accessor);
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLMapping generateCollectionMappingForReferenceProperty(ReferenceProperty property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLChoiceCollectionMapping mapping=new XMLChoiceCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    if (property.getSetMethodName() != null) {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
 else {
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  List<ElementDeclaration> referencedElements=property.getReferencedElements();
  boolean hasJAXBElements=false;
  AttributeAccessor mappingAccessor=mapping.getAttributeAccessor();
  Map<QName,Class> qNamesToScopeClass=new HashMap<QName,Class>();
  for (  ElementDeclaration element : referencedElements) {
    QName elementName=element.getElementName();
    XMLField xmlField=this.getXPathForElement("String_Node_Str",elementName,namespaceInfo,!(this.typeInfo.containsKey(element.getJavaTypeName())));
    mapping.addChoiceElement(xmlField,element.getJavaTypeName());
    if (!element.isXmlRootElement()) {
      XMLRootConverter converter=new XMLRootConverter(xmlField);
      mapping.addConverter(xmlField,converter);
      qNamesToScopeClass.put(elementName,element.getScopeClass());
    }
    hasJAXBElements=hasJAXBElements || !element.isXmlRootElement();
  }
  if (hasJAXBElements) {
    JAXBElementAttributeAccessor accessor=new JAXBElementAttributeAccessor(mappingAccessor,mapping.getContainerPolicy());
    accessor.setQNamesToScopes(qNamesToScopeClass);
    mapping.setAttributeAccessor(accessor);
  }
  descriptor.addMapping(mapping);
  return mapping;
}