Program: 64783
Project: 64783
Buggy source:
/** 
 * INTERNAL: This method is invoked only for the abstract descriptors.
 */
public Class classFromRow(AbstractRecord rowFromDatabase,AbstractSession session) throws DescriptorException {
  ((XMLRecord)rowFromDatabase).setSession(session);
  if (hasClassExtractor() || shouldUseClassNameAsIndicator()) {
    return super.classFromRow(rowFromDatabase,session);
  }
  Object indicator=rowFromDatabase.get(getClassIndicatorField());
  if (indicator == AbstractRecord.noEntry) {
    return null;
  }
  if (indicator == null) {
    return null;
  }
  Class concreteClass;
  if (indicator instanceof String) {
    boolean namespaceAware=((XMLRecord)rowFromDatabase).isNamespaceAware();
    String indicatorValue=(String)indicator;
    int index=indicatorValue.indexOf(((XMLRecord)rowFromDatabase).getNamespaceSeparator());
    if (index == -1) {
      if (namespaceAware && usesXsiType) {
        String uri=((XMLRecord)rowFromDatabase).resolveNamespacePrefix(null);
        if (uri == null) {
          concreteClass=(Class)this.classIndicatorMapping.get(new XPathQName(((XMLRecord)rowFromDatabase).getNamespaceResolver().getDefaultNamespaceURI(),indicatorValue,namespaceAware));
        }
 else {
          XPathQName qname=new XPathQName(uri,indicatorValue,namespaceAware);
          concreteClass=(Class)this.classIndicatorMapping.get(qname);
        }
      }
 else {
        XPathQName qname=new XPathQName(indicatorValue,namespaceAware);
        concreteClass=(Class)this.classIndicatorMapping.get(qname);
      }
    }
 else {
      String prefix=indicatorValue.substring(0,index);
      String localPart=indicatorValue.substring(index + 1);
      String uri=((XMLRecord)rowFromDatabase).resolveNamespacePrefix(prefix);
      if (uri != null) {
        XPathQName qname=new XPathQName(uri,localPart,namespaceAware);
        concreteClass=(Class)this.classIndicatorMapping.get(qname);
      }
 else {
        concreteClass=(Class)this.classIndicatorMapping.get(indicatorValue);
      }
    }
  }
 else {
    concreteClass=(Class)this.classIndicatorMapping.get(indicator);
  }
  if (concreteClass == null) {
    throw DescriptorException.missingClassForIndicatorFieldValue(indicator,getDescriptor());
  }
  return concreteClass;
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method is invoked only for the abstract descriptors.
 */
public Class classFromRow(AbstractRecord rowFromDatabase,AbstractSession session) throws DescriptorException {
  ((XMLRecord)rowFromDatabase).setSession(session);
  if (hasClassExtractor() || shouldUseClassNameAsIndicator()) {
    return super.classFromRow(rowFromDatabase,session);
  }
  Object indicator=rowFromDatabase.get(getClassIndicatorField());
  if (indicator == AbstractRecord.noEntry) {
    return null;
  }
  if (indicator == null) {
    return null;
  }
  Class concreteClass;
  if (indicator instanceof String) {
    boolean namespaceAware=((XMLRecord)rowFromDatabase).isNamespaceAware();
    String indicatorValue=(String)indicator;
    int index=indicatorValue.indexOf(((XMLRecord)rowFromDatabase).getNamespaceSeparator());
    if (index == -1) {
      if (namespaceAware && usesXsiType) {
        String uri=((XMLRecord)rowFromDatabase).resolveNamespacePrefix(null);
        if (uri == null && ((XMLRecord)rowFromDatabase).getNamespaceResolver() != null) {
          uri=((XMLRecord)rowFromDatabase).getNamespaceResolver().getDefaultNamespaceURI();
        }
        XPathQName qname=new XPathQName(uri,indicatorValue,namespaceAware);
        concreteClass=(Class)this.classIndicatorMapping.get(qname);
      }
 else {
        XPathQName qname=new XPathQName(indicatorValue,namespaceAware);
        concreteClass=(Class)this.classIndicatorMapping.get(qname);
      }
    }
 else {
      String prefix=indicatorValue.substring(0,index);
      String localPart=indicatorValue.substring(index + 1);
      String uri=((XMLRecord)rowFromDatabase).resolveNamespacePrefix(prefix);
      if (uri != null) {
        XPathQName qname=new XPathQName(uri,localPart,namespaceAware);
        concreteClass=(Class)this.classIndicatorMapping.get(qname);
      }
 else {
        concreteClass=(Class)this.classIndicatorMapping.get(indicatorValue);
      }
    }
  }
 else {
    concreteClass=(Class)this.classIndicatorMapping.get(indicator);
  }
  if (concreteClass == null) {
    throw DescriptorException.missingClassForIndicatorFieldValue(indicator,getDescriptor());
  }
  return concreteClass;
}