Program: 64841
Project: 64841
Buggy source:
/** 
 * INTERNAL:
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType){
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue=this.getAttributeValueFromObject(object);
  if (attributeValue == null) {
    row.put(this.getField(),null);
    return;
  }
  ContainerPolicy cp=this.getContainerPolicy();
  Vector elements=new Vector(cp.sizeFor(attributeValue));
  Object iter=cp.iteratorFor(attributeValue);
  if (null != iter) {
    while (cp.hasNext(iter)) {
      Object element=cp.next(iter,session);
      if (null != valueConverter) {
        if (valueConverter instanceof XMLConverter) {
          element=((XMLConverter)valueConverter).convertObjectValueToDataValue(element,session,((XMLRecord)row).getMarshaller());
        }
 else {
          element=valueConverter.convertObjectValueToDataValue(element,session);
        }
      }
      if (element != null) {
        elements.addElement(element);
      }
 else {
        AbstractNullPolicy nullPolicy=getNullPolicy();
        if (nullPolicy == null) {
          elements.addElement(null);
        }
 else {
          if (nullPolicy.getMarshalNullRepresentation() == XMLNullRepresentationType.XSI_NIL) {
            elements.addElement(XMLRecord.NIL);
          }
 else           if (nullPolicy.getMarshalNullRepresentation() == XMLNullRepresentationType.ABSENT_NODE) {
          }
 else {
            elements.addElement(XMLConstants.EMPTY_STRING);
          }
        }
      }
    }
  }
  Object fieldValue=null;
  if (!elements.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromDirectValues(elements,elementDataTypeName,session);
  }
  row.put(this.getField(),fieldValue);
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType){
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue=this.getAttributeValueFromObject(object);
  if (attributeValue == null) {
    row.put(this.getField(),null);
    return;
  }
  ContainerPolicy cp=this.getContainerPolicy();
  Vector elements=new Vector(cp.sizeFor(attributeValue));
  Object iter=cp.iteratorFor(attributeValue);
  if (null != iter) {
    while (cp.hasNext(iter)) {
      Object element=cp.next(iter,session);
      if (null != valueConverter) {
        if (valueConverter instanceof XMLConverter) {
          element=((XMLConverter)valueConverter).convertObjectValueToDataValue(element,session,((XMLRecord)row).getMarshaller());
        }
 else {
          element=valueConverter.convertObjectValueToDataValue(element,session);
        }
      }
      if (element != null) {
        elements.addElement(element);
      }
 else       if (!usesSingleNode()) {
        AbstractNullPolicy nullPolicy=getNullPolicy();
        if (nullPolicy == null) {
          elements.addElement(null);
        }
 else {
          if (nullPolicy.getMarshalNullRepresentation() == XMLNullRepresentationType.XSI_NIL) {
            elements.addElement(XMLRecord.NIL);
          }
 else           if (nullPolicy.getMarshalNullRepresentation() == XMLNullRepresentationType.ABSENT_NODE) {
          }
 else {
            elements.addElement(XMLConstants.EMPTY_STRING);
          }
        }
      }
    }
  }
  Object fieldValue=null;
  if (!elements.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromDirectValues(elements,elementDataTypeName,session);
  }
  row.put(this.getField(),fieldValue);
}