Program: 67820
Project: 67820
Buggy source:
/** 
 * INTERNAL: Convert the Oracle XMLDocument to the reference-class.
 */
public Object xmlToObject(DOMRecord xmlRow,Class referenceClass) throws XMLMarshalException {
  String xmlEncoding="String_Node_Str";
  String xmlVersion="String_Node_Str";
  try {
    Method getEncoding=PrivilegedAccessHelper.getMethod(xmlRow.getDocument().getClass(),"String_Node_Str",new Class[]{},true);
    Method getVersion=PrivilegedAccessHelper.getMethod(xmlRow.getDocument().getClass(),"String_Node_Str",new Class[]{},true);
    xmlEncoding=(String)PrivilegedAccessHelper.invokeMethod(getEncoding,xmlRow.getDocument(),new Object[]{});
    xmlVersion=(String)PrivilegedAccessHelper.invokeMethod(getVersion,xmlRow.getDocument(),new Object[]{});
  }
 catch (  Exception ex) {
  }
  XMLContext xmlContext=xmlUnmarshaller.getXMLContext();
  if (XMLConversionManager.getDefaultJavaTypes().get(referenceClass) != null) {
    Object nodeVal;
    try {
      Text rootTxt=(Text)xmlRow.getDOM().getFirstChild();
      nodeVal=rootTxt.getNodeValue();
    }
 catch (    Exception ex) {
      nodeVal=null;
    }
    Object obj=((XMLConversionManager)xmlContext.getSession(0).getDatasourcePlatform().getConversionManager()).convertObject(nodeVal,referenceClass);
    XMLRoot xmlRoot=new XMLRoot();
    xmlRoot.setObject(obj);
    String lName=xmlRow.getDOM().getLocalName();
    if (lName == null) {
      lName=xmlRow.getDOM().getNodeName();
    }
    xmlRoot.setLocalName(lName);
    xmlRoot.setNamespaceURI(xmlRow.getDOM().getNamespaceURI());
    xmlRoot.setEncoding(xmlEncoding);
    xmlRoot.setVersion(xmlVersion);
    return xmlRoot;
  }
  AbstractSession readSession=xmlContext.getReadSession(referenceClass);
  ReadObjectQuery query=new ReadObjectQuery();
  query.setReferenceClass(referenceClass);
  query.setSession(readSession);
  XMLDescriptor descriptor=(XMLDescriptor)readSession.getDescriptor(referenceClass);
  if (descriptor == null) {
    throw XMLMarshalException.descriptorNotFoundInProject(referenceClass.getName());
  }
  xmlRow.setUnmarshaller(xmlUnmarshaller);
  xmlRow.setDocPresPolicy(xmlContext.getDocumentPreservationPolicy(readSession));
  XMLObjectBuilder objectBuilder=(XMLObjectBuilder)descriptor.getObjectBuilder();
  Object object=objectBuilder.buildObject(query,xmlRow,null);
  xmlUnmarshaller.resolveReferences(readSession);
  String elementNamespaceUri=xmlRow.getDOM().getNamespaceURI();
  String elementLocalName=xmlRow.getDOM().getLocalName();
  if (elementLocalName == null) {
    elementLocalName=xmlRow.getDOM().getNodeName();
  }
  String elementPrefix=xmlRow.getDOM().getPrefix();
  return descriptor.wrapObjectInXMLRoot(object,elementNamespaceUri,elementLocalName,elementPrefix,xmlEncoding,xmlVersion,this.isResultAlwaysXMLRoot);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convert the Oracle XMLDocument to the reference-class.
 */
public Object xmlToObject(DOMRecord xmlRow,Class referenceClass) throws XMLMarshalException {
  String xmlEncoding="String_Node_Str";
  String xmlVersion="String_Node_Str";
  try {
    Method getEncoding=PrivilegedAccessHelper.getMethod(xmlRow.getDocument().getClass(),"String_Node_Str",new Class[]{},true);
    Method getVersion=PrivilegedAccessHelper.getMethod(xmlRow.getDocument().getClass(),"String_Node_Str",new Class[]{},true);
    xmlEncoding=(String)PrivilegedAccessHelper.invokeMethod(getEncoding,xmlRow.getDocument(),new Object[]{});
    xmlVersion=(String)PrivilegedAccessHelper.invokeMethod(getVersion,xmlRow.getDocument(),new Object[]{});
  }
 catch (  Exception ex) {
  }
  XMLContext xmlContext=xmlUnmarshaller.getXMLContext();
  if (XMLConversionManager.getDefaultJavaTypes().get(referenceClass) != null || ClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(referenceClass) || ClassConstants.DURATION.isAssignableFrom(referenceClass)) {
    Object nodeVal;
    try {
      Text rootTxt=(Text)xmlRow.getDOM().getFirstChild();
      nodeVal=rootTxt.getNodeValue();
    }
 catch (    Exception ex) {
      nodeVal=null;
    }
    Object obj=((XMLConversionManager)xmlContext.getSession(0).getDatasourcePlatform().getConversionManager()).convertObject(nodeVal,referenceClass);
    XMLRoot xmlRoot=new XMLRoot();
    xmlRoot.setObject(obj);
    String lName=xmlRow.getDOM().getLocalName();
    if (lName == null) {
      lName=xmlRow.getDOM().getNodeName();
    }
    xmlRoot.setLocalName(lName);
    xmlRoot.setNamespaceURI(xmlRow.getDOM().getNamespaceURI());
    xmlRoot.setEncoding(xmlEncoding);
    xmlRoot.setVersion(xmlVersion);
    return xmlRoot;
  }
  AbstractSession readSession=xmlContext.getReadSession(referenceClass);
  ReadObjectQuery query=new ReadObjectQuery();
  query.setReferenceClass(referenceClass);
  query.setSession(readSession);
  XMLDescriptor descriptor=(XMLDescriptor)readSession.getDescriptor(referenceClass);
  if (descriptor == null) {
    throw XMLMarshalException.descriptorNotFoundInProject(referenceClass.getName());
  }
  xmlRow.setUnmarshaller(xmlUnmarshaller);
  xmlRow.setDocPresPolicy(xmlContext.getDocumentPreservationPolicy(readSession));
  XMLObjectBuilder objectBuilder=(XMLObjectBuilder)descriptor.getObjectBuilder();
  Object object=objectBuilder.buildObject(query,xmlRow,null);
  xmlUnmarshaller.resolveReferences(readSession);
  String elementNamespaceUri=xmlRow.getDOM().getNamespaceURI();
  String elementLocalName=xmlRow.getDOM().getLocalName();
  if (elementLocalName == null) {
    elementLocalName=xmlRow.getDOM().getNodeName();
  }
  String elementPrefix=xmlRow.getDOM().getPrefix();
  return descriptor.wrapObjectInXMLRoot(object,elementNamespaceUri,elementLocalName,elementPrefix,xmlEncoding,xmlVersion,this.isResultAlwaysXMLRoot);
}