Program: 66413
Project: 66413
Buggy source:
protected ClassDescriptor buildXMLObjectReferenceMappingDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(XMLObjectReferenceMapping.class);
  descriptor.getInheritancePolicy().setParentClass(AggregateMapping.class);
  XMLCompositeCollectionMapping sourceToTargetKeyFieldAssociationsMapping=new XMLCompositeCollectionMapping();
  sourceToTargetKeyFieldAssociationsMapping.setReferenceClass(Association.class);
  sourceToTargetKeyFieldAssociationsMapping.setAttributeAccessor(new AttributeAccessor(){
    public Object getAttributeValueFromObject(    Object object){
      Map sourceToTargetKeyFields=((XMLObjectReferenceMapping)object).getSourceToTargetKeyFieldAssociations();
      List associations=new ArrayList(sourceToTargetKeyFields.size());
      Iterator iterator=sourceToTargetKeyFields.entrySet().iterator();
      while (iterator.hasNext()) {
        Map.Entry entry=(Map.Entry)iterator.next();
        associations.add(new Association(entry.getKey(),entry.getValue()));
      }
      return associations;
    }
    public void setAttributeValueInObject(    Object object,    Object value){
      XMLObjectReferenceMapping mapping=(XMLObjectReferenceMapping)object;
      List associations=(List)value;
      mapping.setSourceToTargetKeyFieldAssociations(new HashMap(associations.size() + 1));
      Iterator iterator=associations.iterator();
      while (iterator.hasNext()) {
        Association association=(Association)iterator.next();
        mapping.getSourceToTargetKeyFieldAssociations().put(association.getKey(),association.getValue());
      }
    }
  }
);
  sourceToTargetKeyFieldAssociationsMapping.setAttributeName("String_Node_Str");
  sourceToTargetKeyFieldAssociationsMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getSecondaryNamespaceXPath()+ "String_Node_Str");
  descriptor.addMapping(sourceToTargetKeyFieldAssociationsMapping);
  XMLCompositeCollectionMapping sourceToTargetKeysMapping=new XMLCompositeCollectionMapping();
  sourceToTargetKeysMapping.setReferenceClass(DatabaseField.class);
  sourceToTargetKeysMapping.setAttributeName("String_Node_Str");
  sourceToTargetKeysMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  descriptor.addMapping(sourceToTargetKeysMapping);
  return descriptor;
}

Fixed version (ground truth):
protected ClassDescriptor buildXMLObjectReferenceMappingDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(XMLObjectReferenceMapping.class);
  descriptor.getInheritancePolicy().setParentClass(AggregateMapping.class);
  XMLCompositeCollectionMapping sourceToTargetKeyFieldAssociationsMapping=new XMLCompositeCollectionMapping();
  sourceToTargetKeyFieldAssociationsMapping.setReferenceClass(Association.class);
  sourceToTargetKeyFieldAssociationsMapping.setAttributeAccessor(new AttributeAccessor(){
    public Object getAttributeValueFromObject(    Object object){
      Map sourceToTargetKeyFields=((XMLObjectReferenceMapping)object).getSourceToTargetKeyFieldAssociations();
      List associations=new ArrayList(sourceToTargetKeyFields.size());
      Iterator iterator=sourceToTargetKeyFields.entrySet().iterator();
      while (iterator.hasNext()) {
        Map.Entry entry=(Map.Entry)iterator.next();
        associations.add(new Association(entry.getKey(),entry.getValue()));
      }
      return associations;
    }
    public void setAttributeValueInObject(    Object object,    Object value){
      XMLObjectReferenceMapping mapping=(XMLObjectReferenceMapping)object;
      List associations=(List)value;
      mapping.setSourceToTargetKeyFieldAssociations(new HashMap(associations.size() + 1));
      Iterator iterator=associations.iterator();
      while (iterator.hasNext()) {
        Association association=(Association)iterator.next();
        mapping.getSourceToTargetKeyFieldAssociations().put(association.getKey(),association.getValue());
      }
    }
  }
);
  sourceToTargetKeyFieldAssociationsMapping.setAttributeName("String_Node_Str");
  sourceToTargetKeyFieldAssociationsMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getSecondaryNamespaceXPath()+ "String_Node_Str");
  descriptor.addMapping(sourceToTargetKeyFieldAssociationsMapping);
  XMLCompositeCollectionMapping sourceToTargetKeysMapping=new XMLCompositeCollectionMapping();
  sourceToTargetKeysMapping.setReferenceClass(DatabaseField.class);
  sourceToTargetKeysMapping.setAttributeName("String_Node_Str");
  sourceToTargetKeysMapping.setXPath(getPrimaryNamespaceXPath() + "String_Node_Str" + getPrimaryNamespaceXPath()+ "String_Node_Str");
  ((XMLField)sourceToTargetKeysMapping.getField()).setLeafElementType(fieldQname);
  descriptor.addMapping(sourceToTargetKeysMapping);
  return descriptor;
}