Program: 66359
Project: 66359
Buggy source:
/** 
 * INTERNAL: Write the attribute value from the object to the row.
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType){
  for (Iterator fieldIt=getFields().iterator(); fieldIt.hasNext(); ) {
    XMLField xmlField=(XMLField)fieldIt.next();
    ContainerPolicy cp=getContainerPolicy();
    Object collection=getAttributeAccessor().getAttributeValueFromObject(object);
    if (collection == null) {
      return;
    }
    Object fieldValue;
    Object objectValue;
    StringBuilder stringValueBuilder=new StringBuilder();
    QName schemaType;
    Object iterator=cp.iteratorFor(collection);
    if (usesSingleNode()) {
      while (cp.hasNext(iterator)) {
        objectValue=cp.next(iterator,session);
        fieldValue=buildFieldValue(objectValue,xmlField,session);
        if (fieldValue != null) {
          schemaType=getSchemaType(xmlField,fieldValue,session);
          String newValue=getValueToWrite(schemaType,fieldValue,session);
          if (newValue != null) {
            stringValueBuilder.append(newValue);
            if (cp.hasNext(iterator)) {
              stringValueBuilder.append(SPACE);
            }
          }
        }
      }
      if (stringValueBuilder.length() > 0) {
        row.put(xmlField,stringValueBuilder.toString());
      }
    }
 else {
      ArrayList keyValues=new ArrayList();
      while (cp.hasNext(iterator)) {
        objectValue=cp.next(iterator,session);
        fieldValue=buildFieldValue(objectValue,xmlField,session);
        if (fieldValue != null) {
          schemaType=getSchemaType(xmlField,fieldValue,session);
          String stringValue=getValueToWrite(schemaType,fieldValue,session);
          keyValues.add(stringValue);
        }
      }
      row.put(xmlField,keyValues);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Write the attribute value from the object to the row.
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType){
  if (this.isReadOnly()) {
    return;
  }
  for (Iterator fieldIt=getFields().iterator(); fieldIt.hasNext(); ) {
    XMLField xmlField=(XMLField)fieldIt.next();
    ContainerPolicy cp=getContainerPolicy();
    Object collection=getAttributeAccessor().getAttributeValueFromObject(object);
    if (collection == null) {
      return;
    }
    Object fieldValue;
    Object objectValue;
    StringBuilder stringValueBuilder=new StringBuilder();
    QName schemaType;
    Object iterator=cp.iteratorFor(collection);
    if (usesSingleNode()) {
      while (cp.hasNext(iterator)) {
        objectValue=cp.next(iterator,session);
        fieldValue=buildFieldValue(objectValue,xmlField,session);
        if (fieldValue != null) {
          schemaType=getSchemaType(xmlField,fieldValue,session);
          String newValue=getValueToWrite(schemaType,fieldValue,session);
          if (newValue != null) {
            stringValueBuilder.append(newValue);
            if (cp.hasNext(iterator)) {
              stringValueBuilder.append(SPACE);
            }
          }
        }
      }
      if (stringValueBuilder.length() > 0) {
        row.put(xmlField,stringValueBuilder.toString());
      }
    }
 else {
      ArrayList keyValues=new ArrayList();
      while (cp.hasNext(iterator)) {
        objectValue=cp.next(iterator,session);
        fieldValue=buildFieldValue(objectValue,xmlField,session);
        if (fieldValue != null) {
          schemaType=getSchemaType(xmlField,fieldValue,session);
          String stringValue=getValueToWrite(schemaType,fieldValue,session);
          keyValues.add(stringValue);
        }
      }
      row.put(xmlField,keyValues);
    }
  }
}