Program: 68482
Project: 68482
Buggy source:
public void startElement(String namespaceURI,String localName,String qName,Attributes atts) throws SAXException {
  try {
    String name;
    if (EMPTY_STRING.equals(localName) || (localName == null)) {
      name=qName;
    }
 else {
      name=localName;
    }
    QName rootQName;
    if (EMPTY_STRING.equals(namespaceURI) || (namespaceURI == null)) {
      rootQName=new QName(name);
    }
 else {
      rootQName=new QName(namespaceURI,name);
    }
    XMLDescriptor xmlDescriptor=xmlContext.getDescriptor(rootQName);
    if (null == xmlDescriptor) {
      String type=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,"String_Node_Str");
      if (null != type) {
        XPathFragment typeFragment=new XPathFragment(type);
        if (null != namespaceMap) {
          if (null == typeFragment.getPrefix()) {
            typeFragment.setNamespaceURI((String)namespaceMap.get(EMPTY_STRING));
          }
 else {
            typeFragment.setNamespaceURI((String)namespaceMap.get(typeFragment.getPrefix()));
          }
        }
        xmlDescriptor=xmlContext.getDescriptorByGlobalType(typeFragment);
      }
      if (null == xmlDescriptor) {
        Object obj=this.xmlReader.getCurrentObject(session,null);
        if (obj != null) {
          xmlDescriptor=(XMLDescriptor)xmlContext.getSession(obj.getClass()).getDescriptor(obj.getClass());
        }
      }
      if (null == xmlDescriptor) {
        Class unmappedContentHandlerClass=unmarshaller.getUnmappedContentHandlerClass();
        if (null == unmappedContentHandlerClass) {
          throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString());
        }
 else {
          UnmappedContentHandler unmappedContentHandler;
          try {
            PrivilegedNewInstanceFromClass privilegedNewInstanceFromClass=new PrivilegedNewInstanceFromClass(unmappedContentHandlerClass);
            unmappedContentHandler=(UnmappedContentHandler)privilegedNewInstanceFromClass.run();
          }
 catch (          ClassCastException e) {
            throw XMLMarshalException.unmappedContentHandlerDoesntImplement(e,unmappedContentHandlerClass.getName());
          }
catch (          IllegalAccessException e) {
            throw XMLMarshalException.errorInstantiatingUnmappedContentHandler(e,unmappedContentHandlerClass.getName());
          }
catch (          InstantiationException e) {
            throw XMLMarshalException.errorInstantiatingUnmappedContentHandler(e,unmappedContentHandlerClass.getName());
          }
          UnmappedContentHandlerWrapper unmappedContentHandlerWrapper=new UnmappedContentHandlerWrapper(unmappedContentHandler,this);
          unmappedContentHandler.setUnmarshalRecord(unmappedContentHandlerWrapper);
          unmappedContentHandler.startElement(namespaceURI,localName,qName,atts);
          xmlReader.setContentHandler(unmappedContentHandler);
          setObject(unmappedContentHandlerWrapper.getCurrentObject());
          return;
        }
      }
    }
    session=xmlContext.getReadSession(xmlDescriptor);
    UnmarshalRecord unmarshalRecord;
    if (xmlDescriptor.hasInheritance()) {
      unmarshalRecord=new UnmarshalRecord(null);
      unmarshalRecord.setNamespaceMap(namespaceMap);
      unmarshalRecord.setUriToPrefixMap(uriToPrefixMap);
      unmarshalRecord.setAttributes(atts);
      Class classValue=xmlDescriptor.getInheritancePolicy().classFromRow(unmarshalRecord,session);
      if (classValue == null) {
        QName leafElementType=xmlDescriptor.getDefaultRootElementType();
        if (leafElementType != null) {
          Object indicator=xmlDescriptor.getInheritancePolicy().getClassIndicatorMapping().get(leafElementType);
          if (indicator == null) {
            throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType,xmlDescriptor.getInheritancePolicy().getDescriptor());
          }
          classValue=(Class)indicator;
        }
      }
      if (classValue != null) {
        xmlDescriptor=(XMLDescriptor)session.getDescriptor(classValue);
      }
 else {
        if (Modifier.isAbstract(xmlDescriptor.getJavaClass().getModifiers())) {
          throw DescriptorException.missingClassIndicatorField(unmarshalRecord,xmlDescriptor.getInheritancePolicy().getDescriptor());
        }
      }
    }
    unmarshalRecord=(UnmarshalRecord)xmlDescriptor.getObjectBuilder().createRecord(session);
    if (locator != null) {
      unmarshalRecord.setDocumentLocator(locator);
    }
    unmarshalRecord.setUnmarshaller(this.unmarshaller);
    unmarshalRecord.setXMLReader(this.getXMLReader());
    unmarshalRecord.startDocument();
    unmarshalRecord.setNamespaceMap(namespaceMap);
    unmarshalRecord.setUriToPrefixMap(uriToPrefixMap);
    unmarshalRecord.startElement(namespaceURI,localName,qName,atts);
    xmlReader.setContentHandler(unmarshalRecord);
    try {
      unmarshalRecord.getXMLReader().setProperty("String_Node_Str",unmarshalRecord);
    }
 catch (    SAXNotRecognizedException ex) {
    }
catch (    SAXNotSupportedException ex) {
    }
    object=xmlDescriptor.wrapObjectInXMLRoot(unmarshalRecord,unmarshaller.isResultAlwaysXMLRoot());
  }
 catch (  EclipseLinkException e) {
    if (null == xmlReader.getErrorHandler()) {
      throw e;
    }
 else {
      SAXParseException saxParseException=new SAXParseException(null,null,null,0,0,e);
      xmlReader.getErrorHandler().error(saxParseException);
    }
  }
}

Fixed version (ground truth):
public void startElement(String namespaceURI,String localName,String qName,Attributes atts) throws SAXException {
  try {
    String name;
    if (EMPTY_STRING.equals(localName) || (localName == null)) {
      name=qName;
    }
 else {
      name=localName;
    }
    QName rootQName;
    if (EMPTY_STRING.equals(namespaceURI) || (namespaceURI == null)) {
      rootQName=new QName(name);
    }
 else {
      rootQName=new QName(namespaceURI,name);
    }
    XMLDescriptor xmlDescriptor=xmlContext.getDescriptor(rootQName);
    if (null == xmlDescriptor) {
      String type=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,"String_Node_Str");
      if (null != type) {
        XPathFragment typeFragment=new XPathFragment(type);
        if (null != namespaceMap) {
          Stack namespaceStack=null;
          if (null == typeFragment.getPrefix()) {
            namespaceStack=(Stack)namespaceMap.get(EMPTY_STRING);
          }
 else {
            namespaceStack=(Stack)namespaceMap.get(typeFragment.getPrefix());
          }
          if (namespaceStack != null && namespaceStack.size() > 0) {
            typeFragment.setNamespaceURI((String)namespaceStack.peek());
          }
        }
        xmlDescriptor=xmlContext.getDescriptorByGlobalType(typeFragment);
      }
      if (null == xmlDescriptor) {
        Object obj=this.xmlReader.getCurrentObject(session,null);
        if (obj != null) {
          xmlDescriptor=(XMLDescriptor)xmlContext.getSession(obj.getClass()).getDescriptor(obj.getClass());
        }
      }
      if (null == xmlDescriptor) {
        Class unmappedContentHandlerClass=unmarshaller.getUnmappedContentHandlerClass();
        if (null == unmappedContentHandlerClass) {
          throw XMLMarshalException.noDescriptorWithMatchingRootElement(rootQName.toString());
        }
 else {
          UnmappedContentHandler unmappedContentHandler;
          try {
            PrivilegedNewInstanceFromClass privilegedNewInstanceFromClass=new PrivilegedNewInstanceFromClass(unmappedContentHandlerClass);
            unmappedContentHandler=(UnmappedContentHandler)privilegedNewInstanceFromClass.run();
          }
 catch (          ClassCastException e) {
            throw XMLMarshalException.unmappedContentHandlerDoesntImplement(e,unmappedContentHandlerClass.getName());
          }
catch (          IllegalAccessException e) {
            throw XMLMarshalException.errorInstantiatingUnmappedContentHandler(e,unmappedContentHandlerClass.getName());
          }
catch (          InstantiationException e) {
            throw XMLMarshalException.errorInstantiatingUnmappedContentHandler(e,unmappedContentHandlerClass.getName());
          }
          UnmappedContentHandlerWrapper unmappedContentHandlerWrapper=new UnmappedContentHandlerWrapper(unmappedContentHandler,this);
          unmappedContentHandler.setUnmarshalRecord(unmappedContentHandlerWrapper);
          unmappedContentHandler.startElement(namespaceURI,localName,qName,atts);
          xmlReader.setContentHandler(unmappedContentHandler);
          setObject(unmappedContentHandlerWrapper.getCurrentObject());
          return;
        }
      }
    }
    session=xmlContext.getReadSession(xmlDescriptor);
    UnmarshalRecord unmarshalRecord;
    if (xmlDescriptor.hasInheritance()) {
      unmarshalRecord=new UnmarshalRecord(null);
      unmarshalRecord.setNamespaceMap(namespaceMap);
      unmarshalRecord.setUriToPrefixMap(uriToPrefixMap);
      unmarshalRecord.setAttributes(atts);
      Class classValue=xmlDescriptor.getInheritancePolicy().classFromRow(unmarshalRecord,session);
      if (classValue == null) {
        QName leafElementType=xmlDescriptor.getDefaultRootElementType();
        if (leafElementType != null) {
          Object indicator=xmlDescriptor.getInheritancePolicy().getClassIndicatorMapping().get(leafElementType);
          if (indicator == null) {
            throw DescriptorException.missingClassForIndicatorFieldValue(leafElementType,xmlDescriptor.getInheritancePolicy().getDescriptor());
          }
          classValue=(Class)indicator;
        }
      }
      if (classValue != null) {
        xmlDescriptor=(XMLDescriptor)session.getDescriptor(classValue);
      }
 else {
        if (Modifier.isAbstract(xmlDescriptor.getJavaClass().getModifiers())) {
          throw DescriptorException.missingClassIndicatorField(unmarshalRecord,xmlDescriptor.getInheritancePolicy().getDescriptor());
        }
      }
    }
    unmarshalRecord=(UnmarshalRecord)xmlDescriptor.getObjectBuilder().createRecord(session);
    if (locator != null) {
      unmarshalRecord.setDocumentLocator(locator);
    }
    unmarshalRecord.setUnmarshaller(this.unmarshaller);
    unmarshalRecord.setXMLReader(this.getXMLReader());
    unmarshalRecord.startDocument();
    unmarshalRecord.setNamespaceMap(namespaceMap);
    unmarshalRecord.setUriToPrefixMap(uriToPrefixMap);
    unmarshalRecord.startElement(namespaceURI,localName,qName,atts);
    xmlReader.setContentHandler(unmarshalRecord);
    try {
      unmarshalRecord.getXMLReader().setProperty("String_Node_Str",unmarshalRecord);
    }
 catch (    SAXNotRecognizedException ex) {
    }
catch (    SAXNotSupportedException ex) {
    }
    object=xmlDescriptor.wrapObjectInXMLRoot(unmarshalRecord,unmarshaller.isResultAlwaysXMLRoot());
  }
 catch (  EclipseLinkException e) {
    if (null == xmlReader.getErrorHandler()) {
      throw e;
    }
 else {
      SAXParseException saxParseException=new SAXParseException(null,null,null,0,0,e);
      xmlReader.getErrorHandler().error(saxParseException);
    }
  }
}