Program: 64836
Project: 64836
Buggy source:
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType){
  XMLRecord record=(XMLRecord)row;
  XMLMarshaller marshaller=record.getMarshaller();
  Object attributeValue=getAttributeValueFromObject(object);
  ContainerPolicy cp=this.getContainerPolicy();
  Vector elements=new Vector(cp.sizeFor(attributeValue));
  XMLField field=(XMLField)getField();
  NamespaceResolver resolver=field.getNamespaceResolver();
  boolean isAttribute=field.getLastXPathFragment().isAttribute();
  String prefix=null;
  XMLField includeField=null;
  if (!isAttribute) {
    if (record.isXOPPackage() && !isSwaRef() && !shouldInlineBinaryData()) {
      field=(XMLField)getField();
      if (resolver != null) {
        prefix=resolver.resolveNamespaceURI(XMLConstants.XOP_URL);
      }
      if (prefix == null) {
        prefix=XMLConstants.XOP_PREFIX;
        resolver=new NamespaceResolver();
        resolver.put(prefix,XMLConstants.XOP_URL);
      }
      includeField=new XMLField(prefix + XMLConstants.COLON + INCLUDE+ "String_Node_Str");
      includeField.setNamespaceResolver(resolver);
    }
  }
  XMLField textField=new XMLField(field.getXPath() + '/' + XMLConstants.TEXT);
  textField.setNamespaceResolver(field.getNamespaceResolver());
  textField.setSchemaType(field.getSchemaType());
  boolean inline=false;
  for (Object iter=cp.iteratorFor(attributeValue); cp.hasNext(iter); ) {
    Object element=cp.next(iter,session);
    element=getValueToWrite(element,object,record,field,includeField,session);
    if (element.getClass() == ClassConstants.ABYTE) {
      inline=true;
    }
    if (element != null) {
      elements.addElement(element);
    }
  }
  Object fieldValue=null;
  if (!elements.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromDirectValues(elements,elementDataTypeName,session);
  }
  if (inline) {
    row.put(textField,fieldValue);
  }
 else {
    row.put(field,fieldValue);
  }
}

Fixed version (ground truth):
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType){
  XMLRecord record=(XMLRecord)row;
  XMLMarshaller marshaller=record.getMarshaller();
  Object attributeValue=getAttributeValueFromObject(object);
  ContainerPolicy cp=this.getContainerPolicy();
  Vector elements=new Vector(cp.sizeFor(attributeValue));
  XMLField field=(XMLField)getField();
  NamespaceResolver resolver=field.getNamespaceResolver();
  boolean isAttribute=field.getLastXPathFragment().isAttribute();
  String prefix=null;
  XMLField includeField=null;
  if (!isAttribute) {
    if (record.isXOPPackage() && !isSwaRef() && !shouldInlineBinaryData()) {
      field=(XMLField)getField();
      if (resolver != null) {
        prefix=resolver.resolveNamespaceURI(XMLConstants.XOP_URL);
      }
      if (prefix == null) {
        prefix=XMLConstants.XOP_PREFIX;
        resolver=new NamespaceResolver();
        resolver.put(prefix,XMLConstants.XOP_URL);
      }
      includeField=new XMLField(prefix + XMLConstants.COLON + INCLUDE+ "String_Node_Str");
      includeField.setNamespaceResolver(resolver);
    }
  }
  XMLField textField=new XMLField(field.getXPath() + '/' + XMLConstants.TEXT);
  textField.setNamespaceResolver(field.getNamespaceResolver());
  textField.setSchemaType(field.getSchemaType());
  boolean inline=false;
  for (Object iter=cp.iteratorFor(attributeValue); cp.hasNext(iter); ) {
    Object element=cp.next(iter,session);
    element=getValueToWrite(element,object,record,field,includeField,session);
    if (element == null) {
      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);
        }
      }
    }
 else {
      if (element.getClass() == ClassConstants.ABYTE) {
        inline=true;
      }
      elements.addElement(element);
    }
  }
  Object fieldValue=null;
  if (!elements.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromDirectValues(elements,elementDataTypeName,session);
  }
  if (inline) {
    row.put(textField,fieldValue);
  }
 else {
    row.put(field,fieldValue);
  }
}