Program: 65668
Project: 65668
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;
  }
  Object classFieldValue=session.getDatasourcePlatform().getConversionManager().convertObject(indicator,getClassIndicatorField().getType());
  if (classFieldValue == null) {
    return null;
  }
  Class concreteClass;
  if (classFieldValue instanceof String) {
    String indicatorValue=(String)classFieldValue;
    int index=indicatorValue.indexOf(XMLConstants.COLON);
    if (index == -1) {
      String uri=((XMLRecord)rowFromDatabase).resolveNamespacePrefix(null);
      if (uri == null) {
        concreteClass=(Class)this.classIndicatorMapping.get(classFieldValue);
      }
 else {
        QName qname=new QName(uri,indicatorValue);
        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) {
        QName qname=new QName(uri,localPart);
        concreteClass=(Class)this.classIndicatorMapping.get(qname);
      }
 else {
        concreteClass=(Class)this.classIndicatorMapping.get(indicatorValue);
      }
    }
  }
 else {
    concreteClass=(Class)this.classIndicatorMapping.get(classFieldValue);
  }
  if (concreteClass == null) {
    throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue,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);
  boolean namespaceAware=((XMLRecord)rowFromDatabase).isNamespaceAware();
  if (hasClassExtractor() || shouldUseClassNameAsIndicator()) {
    return super.classFromRow(rowFromDatabase,session);
  }
  Object indicator=rowFromDatabase.get(getClassIndicatorField());
  if (indicator == AbstractRecord.noEntry) {
    return null;
  }
  Object classFieldValue=session.getDatasourcePlatform().getConversionManager().convertObject(indicator,getClassIndicatorField().getType());
  if (classFieldValue == null) {
    return null;
  }
  Class concreteClass;
  if (classFieldValue instanceof String) {
    String indicatorValue=(String)classFieldValue;
    int index=indicatorValue.indexOf(((XMLRecord)rowFromDatabase).getNamespaceSeparator());
    if (index == -1) {
      if (namespaceAware) {
        String uri=((XMLRecord)rowFromDatabase).resolveNamespacePrefix(null);
        if (uri == null) {
          concreteClass=(Class)this.classIndicatorMapping.get(classFieldValue);
        }
 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(classFieldValue);
  }
  if (concreteClass == null) {
    throw DescriptorException.missingClassForIndicatorFieldValue(classFieldValue,getDescriptor());
  }
  return concreteClass;
}