Program: 64461
Project: 64461
Buggy source:
@Override public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  Descriptor referenceDescriptor=(Descriptor)getMapping().getReferenceDescriptor();
  TreeObjectBuilder treeObjectBuilder=(TreeObjectBuilder)referenceDescriptor.getObjectBuilder();
  MappingNodeValue textMappingNodeValue=(MappingNodeValue)treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue();
  Mapping textMapping=textMappingNodeValue.getMapping();
  Object childObject=referenceDescriptor.getInstantiationPolicy().buildNewInstance();
  if (textMapping.isAbstractDirectMapping()) {
    DirectMapping xmlDirectMapping=(DirectMapping)textMappingNodeValue.getMapping();
    Field xmlField=(Field)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();
    CompositeObjectMapping nestedXMLCompositeObjectMapping=(CompositeObjectMapping)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);
  Descriptor referenceDescriptor=(Descriptor)getMapping().getReferenceDescriptor();
  ObjectBuilder treeObjectBuilder=(ObjectBuilder)referenceDescriptor.getObjectBuilder();
  MappingNodeValue textMappingNodeValue=(MappingNodeValue)treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue();
  Mapping textMapping=textMappingNodeValue.getMapping();
  Object childObject=referenceDescriptor.getInstantiationPolicy().buildNewInstance();
  if (textMapping.isAbstractDirectMapping()) {
    DirectMapping xmlDirectMapping=(DirectMapping)textMappingNodeValue.getMapping();
    Field xmlField=(Field)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();
    CompositeObjectMapping nestedXMLCompositeObjectMapping=(CompositeObjectMapping)textMappingNodeValue.getMapping();
    unmarshalRecord.setCurrentObject(childObject);
    textMappingNodeValue.attribute(unmarshalRecord,namespaceURI,localName,value);
    unmarshalRecord.setCurrentObject(oldChildObject);
  }
  setAttributeValue(childObject,unmarshalRecord);
}