Program: 67348
Project: 67348
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    XMLDescriptor xmlDescriptor=(XMLDescriptor)xmlCompositeCollectionMapping.getReferenceDescriptor();
    if (xmlDescriptor == null) {
      xmlDescriptor=findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,xmlCompositeCollectionMapping,xmlCompositeCollectionMapping.getKeepAsElementPolicy());
      if (xmlDescriptor == null) {
        if (xmlCompositeCollectionMapping.getField() != null) {
          QName leafType=((XMLField)xmlCompositeCollectionMapping.getField()).getLastXPathFragment().getLeafElementType();
          if (leafType != null) {
            XPathFragment frag=new XPathFragment();
            String xpath=leafType.getLocalPart();
            String uri=leafType.getNamespaceURI();
            if ((uri != null) && !uri.equals("String_Node_Str")) {
              frag.setNamespaceURI(uri);
              String prefix=((XMLDescriptor)xmlCompositeCollectionMapping.getDescriptor()).getNonNullNamespaceResolver().resolveNamespaceURI(uri);
              if ((prefix != null) && !prefix.equals("String_Node_Str")) {
                xpath=prefix + "String_Node_Str" + xpath;
              }
            }
            frag.setXPath(xpath);
            XMLContext xmlContext=unmarshalRecord.getUnmarshaller().getXMLContext();
            xmlDescriptor=xmlContext.getDescriptorByGlobalType(frag);
          }
        }
      }
      UnmarshalKeepAsElementPolicy policy=xmlCompositeCollectionMapping.getKeepAsElementPolicy();
      if (((xmlDescriptor == null) && (policy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT)) || (policy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
        setupHandlerForKeepAsElementPolicy(unmarshalRecord,xPathFragment,atts);
        return true;
      }
    }
    if (xmlCompositeCollectionMapping.getNullPolicy().valueIsNull(atts)) {
      getContainerPolicy().addInto(null,unmarshalRecord.getContainerInstance(this),unmarshalRecord.getSession());
    }
 else {
      XMLField xmlFld=(XMLField)this.xmlCompositeCollectionMapping.getField();
      if (xmlFld.hasLastXPathFragment()) {
        unmarshalRecord.setLeafElementType(xmlFld.getLastXPathFragment().getLeafElementType());
      }
      processChild(xPathFragment,unmarshalRecord,atts,xmlDescriptor,xmlCompositeCollectionMapping);
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    XMLDescriptor xmlDescriptor=(XMLDescriptor)xmlCompositeCollectionMapping.getReferenceDescriptor();
    if (xmlDescriptor == null) {
      xmlDescriptor=findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,xmlCompositeCollectionMapping,xmlCompositeCollectionMapping.getKeepAsElementPolicy());
      if (xmlDescriptor == null) {
        if (xmlCompositeCollectionMapping.getField() != null) {
          QName leafType=((XMLField)xmlCompositeCollectionMapping.getField()).getLastXPathFragment().getLeafElementType();
          if (leafType != null) {
            XPathFragment frag=new XPathFragment();
            String xpath=leafType.getLocalPart();
            String uri=leafType.getNamespaceURI();
            if ((uri != null) && !uri.equals("String_Node_Str")) {
              frag.setNamespaceURI(uri);
              String prefix=((XMLDescriptor)xmlCompositeCollectionMapping.getDescriptor()).getNonNullNamespaceResolver().resolveNamespaceURI(uri);
              if ((prefix != null) && !prefix.equals("String_Node_Str")) {
                xpath=prefix + "String_Node_Str" + xpath;
              }
            }
            frag.setXPath(xpath);
            XMLContext xmlContext=unmarshalRecord.getUnmarshaller().getXMLContext();
            xmlDescriptor=xmlContext.getDescriptorByGlobalType(frag);
          }
        }
      }
      UnmarshalKeepAsElementPolicy policy=xmlCompositeCollectionMapping.getKeepAsElementPolicy();
      if (((xmlDescriptor == null) && (policy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT)) || (policy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
        if (unmarshalRecord.getTypeQName() != null) {
          Class theClass=(Class)((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).getDefaultXMLTypes().get(unmarshalRecord.getTypeQName());
          if (theClass == null) {
            setupHandlerForKeepAsElementPolicy(unmarshalRecord,xPathFragment,atts);
            return true;
          }
        }
 else {
          setupHandlerForKeepAsElementPolicy(unmarshalRecord,xPathFragment,atts);
          return true;
        }
      }
    }
    if (xmlCompositeCollectionMapping.getNullPolicy().valueIsNull(atts)) {
      getContainerPolicy().addInto(null,unmarshalRecord.getContainerInstance(this),unmarshalRecord.getSession());
    }
 else {
      XMLField xmlFld=(XMLField)this.xmlCompositeCollectionMapping.getField();
      if (xmlFld.hasLastXPathFragment()) {
        unmarshalRecord.setLeafElementType(xmlFld.getLastXPathFragment().getLeafElementType());
      }
      processChild(xPathFragment,unmarshalRecord,atts,xmlDescriptor,xmlCompositeCollectionMapping);
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
  return true;
}