Program: 65634
Project: 65634
Buggy source:
/** 
 * INTERNAL:
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType) throws DescriptorException {
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue=this.getAttributeValueFromObject(object);
  if (attributeValue == null) {
    row.put(this.getField(),null);
    return;
  }
  ContainerPolicy cp=this.getContainerPolicy();
  Vector nestedRows=new Vector(cp.sizeFor(attributeValue));
  for (Object iter=cp.iteratorFor(attributeValue); cp.hasNext(iter); ) {
    Object element=cp.next(iter,session);
    if (hasConverter()) {
      if (getConverter() instanceof XMLConverter) {
        element=((XMLConverter)getConverter()).convertObjectValueToDataValue(element,session,((XMLRecord)row).getMarshaller());
      }
 else {
        element=getConverter().convertObjectValueToDataValue(element,session);
      }
    }
    if (element == null) {
      XMLNullRepresentationType nullRepresentation=getNullPolicy().getMarshalNullRepresentation();
      if (nullRepresentation == XMLNullRepresentationType.XSI_NIL) {
        nestedRows.add(XMLRecord.NIL);
      }
 else       if (nullRepresentation == XMLNullRepresentationType.EMPTY_NODE) {
        Node emptyNode=XPathEngine.getInstance().createUnownedElement(((XMLRecord)row).getDOM(),(XMLField)field);
        DOMRecord nestedRow=new DOMRecord(emptyNode);
        nestedRows.add(nestedRow);
      }
    }
 else {
      nestedRows.addElement(buildCompositeRow(element,session,row,writeType));
    }
  }
  Object fieldValue=null;
  if (!nestedRows.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromNestedRows(nestedRows,getStructureName(),session);
  }
  row.put(this.getField(),fieldValue);
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType) throws DescriptorException {
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue=this.getAttributeValueFromObject(object);
  if (attributeValue == null) {
    row.put(this.getField(),null);
    return;
  }
  ContainerPolicy cp=this.getContainerPolicy();
  Vector nestedRows=new Vector(cp.sizeFor(attributeValue));
  Object iter=cp.iteratorFor(attributeValue);
  if (null != iter) {
    while (cp.hasNext(iter)) {
      Object element=cp.next(iter,session);
      if (hasConverter()) {
        if (getConverter() instanceof XMLConverter) {
          element=((XMLConverter)getConverter()).convertObjectValueToDataValue(element,session,((XMLRecord)row).getMarshaller());
        }
 else {
          element=getConverter().convertObjectValueToDataValue(element,session);
        }
      }
      if (element == null) {
        XMLNullRepresentationType nullRepresentation=getNullPolicy().getMarshalNullRepresentation();
        if (nullRepresentation == XMLNullRepresentationType.XSI_NIL) {
          nestedRows.add(XMLRecord.NIL);
        }
 else         if (nullRepresentation == XMLNullRepresentationType.EMPTY_NODE) {
          Node emptyNode=XPathEngine.getInstance().createUnownedElement(((XMLRecord)row).getDOM(),(XMLField)field);
          DOMRecord nestedRow=new DOMRecord(emptyNode);
          nestedRows.add(nestedRow);
        }
      }
 else {
        nestedRows.addElement(buildCompositeRow(element,session,row,writeType));
      }
    }
  }
  Object fieldValue=null;
  if (!nestedRows.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromNestedRows(nestedRows,getStructureName(),session);
  }
  row.put(this.getField(),fieldValue);
}