Program: 68827
Project: 68827
Buggy source:
public void startDocument(XMLMapping selfRecordMapping) throws SAXException {
  try {
    Object object=this.getXMLReader().getCurrentObject(session,selfRecordMapping);
    if (object == null) {
      object=treeObjectBuilder.buildNewInstance();
    }
    this.setCurrentObject(object);
    if ((this.unmarshaller != null) && (this.unmarshaller.getUnmarshalListener() != null)) {
      if (this.parentRecord != null) {
        this.unmarshaller.getUnmarshalListener().beforeUnmarshal(object,parentRecord.getCurrentObject());
      }
 else {
        this.unmarshaller.getUnmarshalListener().beforeUnmarshal(object,null);
      }
    }
    if (parentRecord != null) {
      this.xmlReader.newObjectEvent(object,parentRecord.getCurrentObject(),selfRecordMapping);
    }
 else {
      this.xmlReader.newObjectEvent(object,null,selfRecordMapping);
    }
    List containerValues=treeObjectBuilder.getContainerValues();
    if (null != containerValues) {
      containersMap=new HashMap(containerValues.size());
      ContainerValue containerValue;
      Object containerInstance;
      int containerValuesSize=containerValues.size();
      for (int x=0; x < containerValuesSize; x++) {
        containerValue=(ContainerValue)containerValues.get(x);
        containerInstance=containerValue.getContainerInstance();
        containersMap.put(containerValue,containerInstance);
      }
    }
    if (null != xPathNode.getSelfChildren()) {
      int selfChildrenSize=xPathNode.getSelfChildren().size();
      selfRecords=new ArrayList(selfChildrenSize);
      XPathNode selfNode;
      for (int x=0; x < selfChildrenSize; x++) {
        selfNode=(XPathNode)xPathNode.getSelfChildren().get(x);
        if (null != selfNode.getNodeValue()) {
          selfRecords.add(selfNode.getNodeValue().buildSelfRecord(this,null));
        }
      }
    }
  }
 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 startDocument(XMLMapping selfRecordMapping) throws SAXException {
  try {
    Object object=this.getXMLReader().getCurrentObject(session,selfRecordMapping);
    if (object == null) {
      object=treeObjectBuilder.buildNewInstance();
    }
    this.setCurrentObject(object);
    if ((this.unmarshaller != null) && (this.unmarshaller.getUnmarshalListener() != null)) {
      if (this.parentRecord != null) {
        this.unmarshaller.getUnmarshalListener().beforeUnmarshal(object,parentRecord.getCurrentObject());
      }
 else {
        this.unmarshaller.getUnmarshalListener().beforeUnmarshal(object,null);
      }
    }
    if (parentRecord != null) {
      this.xmlReader.newObjectEvent(object,parentRecord.getCurrentObject(),selfRecordMapping);
    }
 else {
      this.xmlReader.newObjectEvent(object,null,selfRecordMapping);
    }
    List containerValues=treeObjectBuilder.getContainerValues();
    if (null != containerValues) {
      containersMap=new HashMap(containerValues.size());
      ContainerValue containerValue;
      Object containerInstance;
      int containerValuesSize=containerValues.size();
      for (int x=0; x < containerValuesSize; x++) {
        containerValue=(ContainerValue)containerValues.get(x);
        containerInstance=containerValue.getContainerInstance();
        containersMap.put(containerValue,containerInstance);
      }
    }
    if (null != xPathNode.getSelfChildren()) {
      int selfChildrenSize=xPathNode.getSelfChildren().size();
      selfRecords=new ArrayList(selfChildrenSize);
      XPathNode selfNode;
      for (int x=0; x < selfChildrenSize; x++) {
        selfNode=(XPathNode)xPathNode.getSelfChildren().get(x);
        if (null != selfNode.getNodeValue()) {
          selfRecords.add(selfNode.getNodeValue().buildSelfRecord(this,attributes));
        }
      }
    }
  }
 catch (  EclipseLinkException e) {
    if (null == xmlReader.getErrorHandler()) {
      throw e;
    }
 else {
      SAXParseException saxParseException=new SAXParseException(null,null,null,0,0,e);
      xmlReader.getErrorHandler().error(saxParseException);
    }
  }
}