Program: 67225
Project: 67225
Buggy source:
public void startElement(String namespaceURI,String localName,String qName,Attributes atts) throws SAXException {
  if (null != xPathNode.getXPathFragment() && xPathNode.getXPathFragment().nameIsText()) {
    if (null != xPathNode.getUnmarshalNodeValue()) {
      xPathNode.getUnmarshalNodeValue().endElement(xPathFragment,this);
      if (xPathNode.getParent() != null) {
        xPathNode=xPathNode.getParent();
      }
    }
  }
  if (rootElementName == null) {
    rootElementName=qName;
    rootElementNamespaceUri=namespaceURI;
    schemaLocation=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_LOCATION);
    noNamespaceSchemaLocation=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.NO_NS_SCHEMA_LOCATION);
  }
  try {
    if (null != selfRecords) {
      int selfRecordsSize=selfRecords.size();
      for (int x=0; x < selfRecordsSize; x++) {
        UnmarshalRecord selfRecord=((UnmarshalRecord)selfRecords.get(x));
        if (selfRecord == null) {
          getXMLReader().setContentHandler(getFragmentBuilder());
          getFragmentBuilder().startElement(namespaceURI,localName,qName,atts);
        }
 else {
          selfRecord.startElement(namespaceURI,localName,qName,atts);
        }
      }
    }
    XPathNode node=getNonAttributeXPathNode(namespaceURI,localName,qName);
    if (null == node) {
      NodeValue parentNodeValue=xPathNode.getUnmarshalNodeValue();
      if ((null == xPathNode.getXPathFragment()) && (parentNodeValue != null)) {
        XPathFragment parentFragment=new XPathFragment();
        if (EMPTY_STRING.equals(namespaceURI)) {
          parentFragment.setLocalName(qName);
          parentFragment.setNamespaceURI(null);
        }
 else {
          parentFragment.setLocalName(localName);
          parentFragment.setNamespaceURI(namespaceURI);
        }
        if (parentNodeValue.startElement(parentFragment,this,atts)) {
          levelIndex++;
        }
 else {
          startUnmappedElement(namespaceURI,localName,qName,atts);
          return;
        }
      }
 else {
        levelIndex++;
        startUnmappedElement(namespaceURI,localName,qName,atts);
        return;
      }
    }
 else {
      xPathNode=node;
      unmarshalContext.startElement(this);
      levelIndex++;
      NodeValue nodeValue=node.getUnmarshalNodeValue();
      if (null != nodeValue) {
        if (!nodeValue.startElement(xPathFragment,this,atts)) {
          startUnmappedElement(namespaceURI,localName,qName,atts);
          return;
        }
      }
      for (int i=0; i < atts.getLength(); i++) {
        String attNamespace=atts.getURI(i);
        String attLocalName=atts.getLocalName(i);
        String value=atts.getValue(i);
        NodeValue attributeNodeValue=null;
        if ((attLocalName == null) || (attLocalName.length() == 0)) {
          String qname=atts.getQName(i);
          if ((qname != null) && (qname.length() > 0)) {
            int idx=qname.indexOf("String_Node_Str");
            attLocalName=qname.substring((idx <= 0) ? 0 : (idx + 1),qname.length());
            String attPrefix=(idx == -1) ? null : qname.substring(0,idx);
            if (((attPrefix != null) && attPrefix.equalsIgnoreCase("String_Node_Str")) || ((attPrefix == null) && attLocalName.equalsIgnoreCase("String_Node_Str"))) {
              attNamespace=XMLConstants.XMLNS_URL;
            }
          }
        }
        if (this.selfRecords != null) {
          for (int j=0; j < selfRecords.size(); j++) {
            UnmarshalRecord nestedRecord=((UnmarshalRecord)selfRecords.get(j));
            if (nestedRecord != null) {
              attributeNodeValue=nestedRecord.getAttributeChildNodeValue(attNamespace,attLocalName);
              if (attributeNodeValue != null) {
                attributeNodeValue.attribute(nestedRecord,attNamespace,attLocalName,value);
              }
            }
          }
        }
        if (attributeNodeValue == null) {
          attributeNodeValue=this.getAttributeChildNodeValue(attNamespace,attLocalName);
          if (attributeNodeValue != null) {
            attributeNodeValue.attribute(this,attNamespace,attLocalName,value);
          }
 else {
            if (xPathNode.getAnyAttributeNodeValue() != null) {
              xPathNode.getAnyAttributeNodeValue().attribute(this,attNamespace,attLocalName,value);
            }
          }
        }
      }
    }
  }
 catch (  EclipseLinkException e) {
    if ((null == xmlReader) || (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 {
  if (null != xPathNode.getXPathFragment() && xPathNode.getXPathFragment().nameIsText()) {
    if (null != xPathNode.getUnmarshalNodeValue()) {
      xPathNode.getUnmarshalNodeValue().endElement(xPathFragment,this);
      if (xPathNode.getParent() != null) {
        xPathNode=xPathNode.getParent();
      }
    }
  }
  if (rootElementName == null) {
    rootElementName=qName;
    rootElementNamespaceUri=namespaceURI;
    schemaLocation=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_LOCATION);
    noNamespaceSchemaLocation=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.NO_NS_SCHEMA_LOCATION);
  }
  try {
    if (null != selfRecords) {
      int selfRecordsSize=selfRecords.size();
      for (int x=0; x < selfRecordsSize; x++) {
        UnmarshalRecord selfRecord=((UnmarshalRecord)selfRecords.get(x));
        if (selfRecord == null) {
          getFragmentBuilder().startElement(namespaceURI,localName,qName,atts);
        }
 else {
          selfRecord.startElement(namespaceURI,localName,qName,atts);
        }
      }
    }
    XPathNode node=getNonAttributeXPathNode(namespaceURI,localName,qName);
    if (null == node) {
      NodeValue parentNodeValue=xPathNode.getUnmarshalNodeValue();
      if ((null == xPathNode.getXPathFragment()) && (parentNodeValue != null)) {
        XPathFragment parentFragment=new XPathFragment();
        if (EMPTY_STRING.equals(namespaceURI)) {
          parentFragment.setLocalName(qName);
          parentFragment.setNamespaceURI(null);
        }
 else {
          parentFragment.setLocalName(localName);
          parentFragment.setNamespaceURI(namespaceURI);
        }
        if (parentNodeValue.startElement(parentFragment,this,atts)) {
          levelIndex++;
        }
 else {
          startUnmappedElement(namespaceURI,localName,qName,atts);
          return;
        }
      }
 else {
        levelIndex++;
        startUnmappedElement(namespaceURI,localName,qName,atts);
        return;
      }
    }
 else {
      xPathNode=node;
      unmarshalContext.startElement(this);
      levelIndex++;
      NodeValue nodeValue=node.getUnmarshalNodeValue();
      if (null != nodeValue) {
        if (!nodeValue.startElement(xPathFragment,this,atts)) {
          startUnmappedElement(namespaceURI,localName,qName,atts);
          return;
        }
      }
      for (int i=0; i < atts.getLength(); i++) {
        String attNamespace=atts.getURI(i);
        String attLocalName=atts.getLocalName(i);
        String value=atts.getValue(i);
        NodeValue attributeNodeValue=null;
        if ((attLocalName == null) || (attLocalName.length() == 0)) {
          String qname=atts.getQName(i);
          if ((qname != null) && (qname.length() > 0)) {
            int idx=qname.indexOf("String_Node_Str");
            attLocalName=qname.substring((idx <= 0) ? 0 : (idx + 1),qname.length());
            String attPrefix=(idx == -1) ? null : qname.substring(0,idx);
            if (((attPrefix != null) && attPrefix.equalsIgnoreCase("String_Node_Str")) || ((attPrefix == null) && attLocalName.equalsIgnoreCase("String_Node_Str"))) {
              attNamespace=XMLConstants.XMLNS_URL;
            }
          }
        }
        if (this.selfRecords != null) {
          for (int j=0; j < selfRecords.size(); j++) {
            UnmarshalRecord nestedRecord=((UnmarshalRecord)selfRecords.get(j));
            if (nestedRecord != null) {
              attributeNodeValue=nestedRecord.getAttributeChildNodeValue(attNamespace,attLocalName);
              if (attributeNodeValue != null) {
                attributeNodeValue.attribute(nestedRecord,attNamespace,attLocalName,value);
              }
            }
          }
        }
        if (attributeNodeValue == null) {
          attributeNodeValue=this.getAttributeChildNodeValue(attNamespace,attLocalName);
          if (attributeNodeValue != null) {
            attributeNodeValue.attribute(this,attNamespace,attLocalName,value);
          }
 else {
            if (xPathNode.getAnyAttributeNodeValue() != null) {
              xPathNode.getAnyAttributeNodeValue().attribute(this,attNamespace,attLocalName,value);
            }
          }
        }
      }
    }
  }
 catch (  EclipseLinkException e) {
    if ((null == xmlReader) || (null == xmlReader.getErrorHandler())) {
      throw e;
    }
 else {
      SAXParseException saxParseException=new SAXParseException(null,null,null,0,0,e);
      xmlReader.getErrorHandler().error(saxParseException);
    }
  }
}