Program: 67429
Project: 67429
Buggy source:
public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session){
  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 ((marshaller.getAttachmentMarshaller() != null) && marshaller.getAttachmentMarshaller().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 + "String_Node_Str" + INCLUDE+ "String_Node_Str");
      includeField.setNamespaceResolver(resolver);
    }
 else {
      XMLField textField=new XMLField(field.getXPath() + "String_Node_Str");
      textField.setNamespaceResolver(field.getNamespaceResolver());
      textField.setSchemaType(field.getSchemaType());
      field=textField;
    }
  }
  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) {
      elements.addElement(element);
    }
  }
  Object fieldValue=null;
  if (!elements.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromDirectValues(elements,elementDataTypeName,session);
  }
  row.put(field,fieldValue);
}

Fixed version (ground truth):
public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session){
  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 + "String_Node_Str" + INCLUDE+ "String_Node_Str");
      includeField.setNamespaceResolver(resolver);
    }
 else {
      XMLField textField=new XMLField(field.getXPath() + "String_Node_Str");
      textField.setNamespaceResolver(field.getNamespaceResolver());
      textField.setSchemaType(field.getSchemaType());
      field=textField;
    }
  }
  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) {
      elements.addElement(element);
    }
  }
  Object fieldValue=null;
  if (!elements.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromDirectValues(elements,elementDataTypeName,session);
  }
  row.put(field,fieldValue);
}