Program: 63643
Project: 63643
Buggy source:
/** 
 * INTERNAL: Initialized the inheritance properties of the descriptor once the mappings are initialized. This is done before formal postInitialize during the end of mapping initialize.
 */
public void initialize(AbstractSession session){
  super.initialize(session);
  if (!this.shouldUseClassNameAsIndicator()) {
    Iterator<Map.Entry> entries=new HashMap(getClassIndicatorMapping()).entrySet().iterator();
    while (entries.hasNext()) {
      Map.Entry entry=entries.next();
      Object key=entry.getKey();
      XPathFragment frag=((XMLField)getClassIndicatorField()).getXPathFragment();
      if (frag.getLocalName().equals(Constants.SCHEMA_TYPE_ATTRIBUTE) && frag.getNamespaceURI() != null && frag.getNamespaceURI().equals(javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI)) {
        usesXsiType=true;
      }
      if (key instanceof String) {
        XPathQName qname;
        String indicatorValue=(String)key;
        if (!usesXsiType || namespaceResolver == null) {
          qname=new XPathQName(indicatorValue,true);
        }
 else {
          int index=indicatorValue.indexOf(Constants.COLON);
          if (index != -1 && namespaceResolver != null) {
            String prefix=indicatorValue.substring(0,index);
            String localPart=indicatorValue.substring(index + 1);
            String uri=namespaceResolver.resolveNamespacePrefix(prefix);
            qname=new XPathQName(uri,localPart,true);
          }
 else {
            qname=new XPathQName(namespaceResolver.getDefaultNamespaceURI(),indicatorValue,true);
          }
        }
        getClassIndicatorMapping().put(qname,entry.getValue());
      }
 else       if (key instanceof QName) {
        XPathQName xpathQName=new XPathQName((QName)key,true);
        getClassIndicatorMapping().put(xpathQName,entry.getValue());
      }
    }
  }
  if (getClassIndicatorField() != null) {
    XMLField classIndicatorXMLField;
    try {
      classIndicatorXMLField=(XMLField)getClassIndicatorField();
    }
 catch (    ClassCastException ex) {
      classIndicatorXMLField=new XMLField(getClassIndicatorField().getName());
      setClassIndicatorField(classIndicatorXMLField);
    }
    XPathFragment frag=classIndicatorXMLField.getLastXPathFragment();
    if ((frag != null) && frag.hasNamespace() && frag.getPrefix() != null && (namespaceResolver != null)) {
      String uri=namespaceResolver.resolveNamespacePrefix(frag.getPrefix());
      classIndicatorXMLField.getLastXPathFragment().setNamespaceURI(uri);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Initialized the inheritance properties of the descriptor once the mappings are initialized. This is done before formal postInitialize during the end of mapping initialize.
 */
public void initialize(AbstractSession session){
  super.initialize(session);
  if (!this.shouldUseClassNameAsIndicator()) {
    if (classIndicatorField != null) {
      XPathFragment frag=((XMLField)classIndicatorField).getXPathFragment();
      if (frag.getLocalName().equals(Constants.SCHEMA_TYPE_ATTRIBUTE) && javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(frag.getNamespaceURI())) {
        usesXsiType=true;
      }
    }
    if (!isChildDescriptor()) {
      Iterator<Map.Entry> entries=new HashMap(getClassIndicatorMapping()).entrySet().iterator();
      while (entries.hasNext()) {
        Map.Entry entry=entries.next();
        Object key=entry.getKey();
        if (key instanceof String) {
          XPathQName qname;
          String indicatorValue=(String)key;
          if (!usesXsiType || namespaceResolver == null) {
            qname=new XPathQName(indicatorValue,true);
          }
 else {
            int index=indicatorValue.indexOf(Constants.COLON);
            if (index != -1 && namespaceResolver != null) {
              String prefix=indicatorValue.substring(0,index);
              String localPart=indicatorValue.substring(index + 1);
              String uri=namespaceResolver.resolveNamespacePrefix(prefix);
              qname=new XPathQName(uri,localPart,true);
            }
 else {
              qname=new XPathQName(namespaceResolver.getDefaultNamespaceURI(),indicatorValue,true);
            }
          }
          getClassIndicatorMapping().put(qname,entry.getValue());
        }
 else         if (key instanceof QName) {
          XPathQName xpathQName=new XPathQName((QName)key,true);
          getClassIndicatorMapping().put(xpathQName,entry.getValue());
        }
      }
    }
  }
  if (getClassIndicatorField() != null) {
    XMLField classIndicatorXMLField;
    try {
      classIndicatorXMLField=(XMLField)getClassIndicatorField();
    }
 catch (    ClassCastException ex) {
      classIndicatorXMLField=new XMLField(getClassIndicatorField().getName());
      setClassIndicatorField(classIndicatorXMLField);
    }
    XPathFragment frag=classIndicatorXMLField.getLastXPathFragment();
    if ((frag != null) && frag.hasNamespace() && frag.getPrefix() != null && (namespaceResolver != null)) {
      String uri=namespaceResolver.resolveNamespacePrefix(frag.getPrefix());
      classIndicatorXMLField.getLastXPathFragment().setNamespaceURI(uri);
    }
  }
}