Program: 65368
Project: 65368
Buggy source:
@Override public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  XMLDescriptor referenceDescriptor=(XMLDescriptor)getMapping().getReferenceDescriptor();
  TreeObjectBuilder treeObjectBuilder=(TreeObjectBuilder)referenceDescriptor.getObjectBuilder();
  MappingNodeValue textMappingNodeValue=(MappingNodeValue)treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue();
  DatabaseMapping textMapping=textMappingNodeValue.getMapping();
  Object childObject=referenceDescriptor.getInstantiationPolicy().buildNewInstance();
  if (textMapping.isAbstractDirectMapping()) {
    XMLDirectMapping xmlDirectMapping=(XMLDirectMapping)textMappingNodeValue.getMapping();
    XMLField xmlField=(XMLField)xmlDirectMapping.getField();
    Object realValue=xmlField.convertValueBasedOnSchemaType(value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
    Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,unmarshalRecord.getSession(),unmarshalRecord);
    xmlDirectMapping.setAttributeValueInObject(childObject,convertedValue);
  }
 else {
    Object oldChildObject=unmarshalRecord.getCurrentObject();
    XMLCompositeObjectMapping nestedXMLCompositeObjectMapping=(XMLCompositeObjectMapping)textMappingNodeValue.getMapping();
    unmarshalRecord.setCurrentObject(childObject);
    textMappingNodeValue.attribute(unmarshalRecord,namespaceURI,localName,value);
    unmarshalRecord.setCurrentObject(oldChildObject);
  }
  setAttributeValue(childObject,unmarshalRecord);
}

Fixed version (ground truth):
@Override public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  XMLDescriptor referenceDescriptor=(XMLDescriptor)getMapping().getReferenceDescriptor();
  TreeObjectBuilder treeObjectBuilder=(TreeObjectBuilder)referenceDescriptor.getObjectBuilder();
  MappingNodeValue textMappingNodeValue=(MappingNodeValue)treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue();
  DatabaseMapping textMapping=textMappingNodeValue.getMapping();
  Object childObject=referenceDescriptor.getInstantiationPolicy().buildNewInstance();
  if (textMapping.isAbstractDirectMapping()) {
    XMLDirectMapping xmlDirectMapping=(XMLDirectMapping)textMappingNodeValue.getMapping();
    XMLField xmlField=(XMLField)xmlDirectMapping.getField();
    Object realValue=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
    Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,unmarshalRecord.getSession(),unmarshalRecord);
    xmlDirectMapping.setAttributeValueInObject(childObject,convertedValue);
  }
 else {
    Object oldChildObject=unmarshalRecord.getCurrentObject();
    XMLCompositeObjectMapping nestedXMLCompositeObjectMapping=(XMLCompositeObjectMapping)textMappingNodeValue.getMapping();
    unmarshalRecord.setCurrentObject(childObject);
    textMappingNodeValue.attribute(unmarshalRecord,namespaceURI,localName,value);
    unmarshalRecord.setCurrentObject(oldChildObject);
  }
  setAttributeValue(childObject,unmarshalRecord);
}