Program: 68740
Project: 68740
Buggy source:
public void beforeMarshal(Object obj){
  if (obj instanceof SDOChangeSummary) {
    SDOChangeSummary changeSummary=((SDOChangeSummary)obj);
    List createdSet=changeSummary.getCreated();
    List xpaths=new ArrayList(createdSet.size());
    if ((createdSet != null) && (createdSet.size() > 0)) {
      Iterator anIterator=createdSet.iterator();
      SDODataObject nextCreatedDO=null;
      while (anIterator.hasNext()) {
        nextCreatedDO=((SDODataObject)anIterator.next());
        xpaths.add(SDOConstants.SDO_CHANGESUMMARY_REF_PATH_PREFIX + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT + getPathFromAncestor(nextCreatedDO,(SDODataObject)marshalledObject,changeSummary));
      }
    }
    changeSummary.setCreatedXPaths(xpaths);
    String xpathMarshalledObjToCS=getPathFromAncestor(((SDODataObject)changeSummary.getRootObject()),(SDODataObject)marshalledObject,changeSummary);
    String xpathChangeSumProp=getXPathForProperty((SDOProperty)((SDOType)changeSummary.getRootObject().getType()).getChangeSummaryProperty());
    String xpathToCS=SDOConstants.SDO_CHANGESUMMARY_REF_PATH_PREFIX;
    if ((xpathMarshalledObjToCS != null) && !xpathMarshalledObjToCS.equals(SDOConstants.EMPTY_STRING)) {
      xpathToCS=xpathToCS + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT + xpathMarshalledObjToCS;
    }
    xpathToCS=xpathToCS + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT + xpathChangeSumProp+ SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT;
    List deletedXPaths=new ArrayList();
    Document document=XMLPlatformFactory.getInstance().getXMLPlatform().createDocument();
    Element csNode=null;
    List modifiedItems=changeSummary.getModified();
    int modifiedSize=modifiedItems.size();
    List newNodes=new ArrayList(modifiedSize);
    SDODataObject nextModifiedDO=null;
    for (int i=0; i < modifiedSize; i++) {
      nextModifiedDO=(SDODataObject)modifiedItems.get(i);
      String sdoPrefix=((SDOTypeHelper)typeHelper).getPrefix(SDOConstants.SDO_URL);
      String uri=getURI(nextModifiedDO);
      String qualifiedName=getQualifiedName(nextModifiedDO);
      String sdoRefPrefix=SDOConstants.SDO_CHANGESUMMARY_REF_PATH_PREFIX + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT;
      if (uri == null) {
        csNode=document.createElement(qualifiedName);
      }
 else {
        csNode=document.createElementNS(uri,qualifiedName);
      }
      csNode.setAttributeNS(SDOConstants.SDO_URL,sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + SDOConstants.CHANGESUMMARY_REF,sdoRefPrefix + getPathFromAncestor(nextModifiedDO,(SDODataObject)marshalledObject,changeSummary));
      Vector namespaces=((SDOType)nextModifiedDO.getType()).getXmlDescriptor().getNonNullNamespaceResolver().getNamespaces();
      for (int j=0; j < namespaces.size(); j++) {
        Namespace next=(Namespace)namespaces.get(j);
        if (declareNamespace(next.getNamespaceURI(),next.getPrefix(),changeSummary.getRootObject())) {
          csNode.setAttributeNS(XMLConstants.XMLNS_URL,XMLConstants.XMLNS + "String_Node_Str" + next.getPrefix(),next.getNamespaceURI());
        }
      }
      List nextDOSettings=changeSummary.getOldValues(nextModifiedDO);
      DOMRecord row=new DOMRecord(csNode);
      SDOSetting nextSetting=null;
      for (int j=0; j < nextDOSettings.size(); j++) {
        nextSetting=(SDOSetting)nextDOSettings.get(j);
        if (nextSetting.isSet()) {
          if (!nextSetting.getProperty().getType().isDataType()) {
            if (nextSetting.getProperty().isMany()) {
              List values=(List)nextSetting.getValue();
              for (int k=0; k < values.size(); k++) {
                doMarshal((SDOProperty)nextSetting.getProperty(),(DataObject)values.get(k),changeSummary,csNode,nextModifiedDO,deletedXPaths,xpathToCS,sdoPrefix);
              }
            }
 else {
              doMarshal((SDOProperty)nextSetting.getProperty(),(DataObject)nextSetting.getValue(),changeSummary,csNode,nextModifiedDO,deletedXPaths,xpathToCS,sdoPrefix);
            }
          }
 else {
            String xPath=getXPathForProperty((SDOProperty)nextSetting.getProperty());
            XMLField field=new XMLField(xPath);
            field.setNamespaceResolver(((SDOTypeHelper)typeHelper).getNamespaceResolver());
            row.put(field,nextSetting.getValue());
          }
        }
      }
      List unsetPropNames=changeSummary.getUnsetProps(nextModifiedDO);
      if (!unsetPropNames.isEmpty()) {
        String unsetPropsString=(String)XMLConversionManager.getDefaultXMLManager().convertObject(unsetPropNames,String.class);
        csNode.setAttributeNS(SDOConstants.SDO_URL,sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + SDOConstants.CHANGESUMMARY_UNSET,unsetPropsString);
      }
      newNodes.add(csNode);
    }
    changeSummary.setDeletedXPaths(deletedXPaths);
    changeSummary.setModifiedDoms(newNodes);
  }
}

Fixed version (ground truth):
public void beforeMarshal(Object obj){
  if (obj instanceof SDOChangeSummary) {
    SDOChangeSummary changeSummary=((SDOChangeSummary)obj);
    List createdSet=changeSummary.getCreated();
    List xpaths=new ArrayList(createdSet.size());
    if ((createdSet != null) && (createdSet.size() > 0)) {
      Iterator anIterator=createdSet.iterator();
      SDODataObject nextCreatedDO=null;
      while (anIterator.hasNext()) {
        nextCreatedDO=((SDODataObject)anIterator.next());
        xpaths.add(SDOConstants.SDO_CHANGESUMMARY_REF_PATH_PREFIX + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT + getPathFromAncestor(nextCreatedDO,(SDODataObject)marshalledObject,changeSummary));
      }
    }
    changeSummary.setCreatedXPaths(xpaths);
    String xpathMarshalledObjToCS=getPathFromAncestor(((SDODataObject)changeSummary.getRootObject()),(SDODataObject)marshalledObject,changeSummary);
    String xpathChangeSumProp=getXPathForProperty((SDOProperty)((SDOType)changeSummary.getRootObject().getType()).getChangeSummaryProperty());
    String xpathToCS=SDOConstants.SDO_CHANGESUMMARY_REF_PATH_PREFIX;
    if ((xpathMarshalledObjToCS != null) && !xpathMarshalledObjToCS.equals(SDOConstants.EMPTY_STRING)) {
      xpathToCS=xpathToCS + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT + xpathMarshalledObjToCS;
    }
    xpathToCS=xpathToCS + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT + xpathChangeSumProp+ SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT;
    List deletedXPaths=new ArrayList();
    Document document=XMLPlatformFactory.getInstance().getXMLPlatform().createDocument();
    Element csNode=null;
    List modifiedItems=changeSummary.getModified();
    int modifiedSize=modifiedItems.size();
    List newNodes=new ArrayList(modifiedSize);
    SDODataObject nextModifiedDO=null;
    for (int i=0; i < modifiedSize; i++) {
      nextModifiedDO=(SDODataObject)modifiedItems.get(i);
      String sdoPrefix=((SDOTypeHelper)typeHelper).getPrefix(SDOConstants.SDO_URL);
      String uri=getURI(nextModifiedDO);
      String qualifiedName=getQualifiedName(nextModifiedDO);
      String sdoRefPrefix=SDOConstants.SDO_CHANGESUMMARY_REF_PATH_PREFIX + SDOConstants.SDO_XPATH_SEPARATOR_FRAGMENT;
      if (uri == null) {
        csNode=document.createElement(qualifiedName);
      }
 else {
        csNode=document.createElementNS(uri,qualifiedName);
      }
      csNode.setAttributeNS(SDOConstants.SDO_URL,sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + SDOConstants.CHANGESUMMARY_REF,sdoRefPrefix + getPathFromAncestor(nextModifiedDO,(SDODataObject)marshalledObject,changeSummary));
      Vector namespaces=((SDOType)nextModifiedDO.getType()).getXmlDescriptor().getNonNullNamespaceResolver().getNamespaces();
      for (int j=0; j < namespaces.size(); j++) {
        Namespace next=(Namespace)namespaces.get(j);
        if (declareNamespace(next.getNamespaceURI(),next.getPrefix(),changeSummary.getRootObject())) {
          csNode.setAttributeNS(XMLConstants.XMLNS_URL,XMLConstants.XMLNS + "String_Node_Str" + next.getPrefix(),next.getNamespaceURI());
        }
      }
      List nextDOSettings=changeSummary.getOldValues(nextModifiedDO);
      DOMRecord row=new DOMRecord(csNode);
      SDOSetting nextSetting=null;
      for (int j=0; j < nextDOSettings.size(); j++) {
        nextSetting=(SDOSetting)nextDOSettings.get(j);
        if (nextSetting.isSet()) {
          if (!nextSetting.getProperty().getType().isDataType()) {
            if (nextSetting.getProperty().isMany()) {
              List values=(List)nextSetting.getValue();
              for (int k=0; k < values.size(); k++) {
                doMarshal((SDOProperty)nextSetting.getProperty(),(DataObject)values.get(k),changeSummary,csNode,nextModifiedDO,deletedXPaths,xpathToCS,sdoPrefix);
              }
            }
 else {
              doMarshal((SDOProperty)nextSetting.getProperty(),(DataObject)nextSetting.getValue(),changeSummary,csNode,nextModifiedDO,deletedXPaths,xpathToCS,sdoPrefix);
            }
          }
 else {
            Object value=nextSetting.getValue();
            if (value == null) {
              marshalNilAttribute((SDOProperty)nextSetting.getProperty(),row);
            }
 else {
              String xPath=getXPathForProperty((SDOProperty)nextSetting.getProperty());
              XMLField field=new XMLField(xPath);
              field.setNamespaceResolver(((SDOTypeHelper)typeHelper).getNamespaceResolver());
              row.put(field,value);
            }
          }
        }
      }
      List unsetPropNames=changeSummary.getUnsetProps(nextModifiedDO);
      if (!unsetPropNames.isEmpty()) {
        String unsetPropsString=(String)XMLConversionManager.getDefaultXMLManager().convertObject(unsetPropNames,String.class);
        csNode.setAttributeNS(SDOConstants.SDO_URL,sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + SDOConstants.CHANGESUMMARY_UNSET,unsetPropsString);
      }
      newNodes.add(csNode);
    }
    changeSummary.setDeletedXPaths(deletedXPaths);
    changeSummary.setModifiedDoms(newNodes);
  }
}