Program: 66948
Project: 66948
Buggy source:
public UnmarshalRecord buildSelfRecord(UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    XMLDescriptor xmlDescriptor=(XMLDescriptor)xmlCompositeObjectMapping.getReferenceDescriptor();
    if (null == xmlDescriptor) {
      xmlDescriptor=findReferenceDescriptor(null,unmarshalRecord,atts,xmlCompositeObjectMapping,xmlCompositeObjectMapping.getKeepAsElementPolicy());
    }
    if (xmlDescriptor != null) {
      if (xmlDescriptor.hasInheritance()) {
        unmarshalRecord.setAttributes(atts);
        Class clazz=xmlDescriptor.getInheritancePolicy().classFromRow(unmarshalRecord,unmarshalRecord.getSession());
        if (clazz == null) {
          QName leafElementType=unmarshalRecord.getLeafElementType();
          if (leafElementType != null) {
            Object indicator=xmlDescriptor.getInheritancePolicy().getClassIndicatorMapping().get(leafElementType);
            if (indicator == null) {
              throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType,xmlDescriptor.getInheritancePolicy().getDescriptor());
            }
            clazz=(Class)indicator;
          }
        }
        if (clazz != null) {
          xmlDescriptor=(XMLDescriptor)unmarshalRecord.getSession().getDescriptor(clazz);
        }
 else {
          if (Modifier.isAbstract(xmlDescriptor.getJavaClass().getModifiers())) {
            throw DescriptorException.missingClassIndicatorField(unmarshalRecord,xmlDescriptor.getInheritancePolicy().getDescriptor());
          }
        }
      }
      TreeObjectBuilder stob2=(TreeObjectBuilder)xmlDescriptor.getObjectBuilder();
      UnmarshalRecord childRecord=(UnmarshalRecord)stob2.createRecord(unmarshalRecord.getSession());
      childRecord.setUnmarshaller(unmarshalRecord.getUnmarshaller());
      childRecord.setSelfRecord(true);
      unmarshalRecord.setChildRecord(childRecord);
      childRecord.setXMLReader(unmarshalRecord.getXMLReader());
      childRecord.startDocument(this.xmlCompositeObjectMapping);
      xmlCompositeObjectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),childRecord.getCurrentObject());
      if (xmlCompositeObjectMapping.getContainerAccessor() != null) {
        xmlCompositeObjectMapping.getContainerAccessor().setAttributeValueInObject(childRecord.getCurrentObject(),unmarshalRecord.getCurrentObject());
      }
      return childRecord;
    }
 else {
      return null;
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

Fixed version (ground truth):
public UnmarshalRecord buildSelfRecord(UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    XMLDescriptor xmlDescriptor=(XMLDescriptor)xmlCompositeObjectMapping.getReferenceDescriptor();
    if (null == xmlDescriptor) {
      xmlDescriptor=findReferenceDescriptor(null,unmarshalRecord,atts,xmlCompositeObjectMapping,xmlCompositeObjectMapping.getKeepAsElementPolicy());
    }
    if (xmlDescriptor != null) {
      if (xmlDescriptor.hasInheritance()) {
        unmarshalRecord.setAttributes(atts);
        Class clazz=xmlDescriptor.getInheritancePolicy().classFromRow(unmarshalRecord,unmarshalRecord.getSession());
        if (clazz == null) {
          QName leafElementType=unmarshalRecord.getLeafElementType();
          if (leafElementType != null) {
            Object indicator=xmlDescriptor.getInheritancePolicy().getClassIndicatorMapping().get(leafElementType);
            if (indicator == null) {
              throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType,xmlDescriptor.getInheritancePolicy().getDescriptor());
            }
            clazz=(Class)indicator;
          }
        }
        if (clazz != null) {
          xmlDescriptor=(XMLDescriptor)unmarshalRecord.getSession().getDescriptor(clazz);
        }
 else {
          if (Modifier.isAbstract(xmlDescriptor.getJavaClass().getModifiers())) {
            throw DescriptorException.missingClassIndicatorField(unmarshalRecord,xmlDescriptor.getInheritancePolicy().getDescriptor());
          }
        }
      }
      TreeObjectBuilder stob2=(TreeObjectBuilder)xmlDescriptor.getObjectBuilder();
      UnmarshalRecord childRecord=(UnmarshalRecord)stob2.createRecord(unmarshalRecord.getSession());
      childRecord.setUnmarshaller(unmarshalRecord.getUnmarshaller());
      childRecord.setSelfRecord(true);
      unmarshalRecord.setChildRecord(childRecord);
      childRecord.setXMLReader(unmarshalRecord.getXMLReader());
      childRecord.startDocument(this.xmlCompositeObjectMapping);
      return childRecord;
    }
 else {
      return null;
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}