Program: 67568
Project: 67568
Buggy source:
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();
    boolean isText=!(this.typeInfo.containsKey(element.getJavaTypeName())) && !(element.getJavaTypeName().equals("String_Node_Str"));
    XMLField xmlField=this.getXPathForElement("String_Node_Str",elementName,namespaceInfo,isText);
    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();
    boolean isText=!(this.typeInfo.containsKey(element.getJavaTypeName()));
    XMLField xmlField=this.getXPathForElement("String_Node_Str",elementName,namespaceInfo,isText);
    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;
}