Program: 65367
Project: 65367
Buggy source:
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if (null == value) {
    return;
  }
  if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    if (unmarshalRecord.isNil() || xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(unmarshalRecord.getAttributes())) {
      return;
    }
  }
  if ((!isWhitespaceAware() && XMLConstants.EMPTY_STRING.equals(value))) {
    value=null;
  }
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager,unmarshalRecord);
  }
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value=((XMLConverter)xmlCompositeDirectCollectionMapping.getValueConverter()).convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
    }
 else {
      value=xmlCompositeDirectCollectionMapping.getValueConverter().convertDataValueToObjectValue(value,unmarshalRecord.getSession());
    }
  }
  if (value != null && value.getClass() == ClassConstants.STRING) {
    if (xmlCompositeDirectCollectionMapping.isCollapsingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().collapseStringValue((String)value);
    }
 else     if (xmlCompositeDirectCollectionMapping.isNormalizingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().normalizeStringValue((String)value);
    }
  }
  unmarshalRecord.addAttributeValue(this,value,collection);
}

Fixed version (ground truth):
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if (null == value) {
    return;
  }
  if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    if (unmarshalRecord.isNil() || xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(unmarshalRecord.getAttributes())) {
      return;
    }
  }
  if ((!isWhitespaceAware() && XMLConstants.EMPTY_STRING.equals(value))) {
    value=null;
  }
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value=((XMLConverter)xmlCompositeDirectCollectionMapping.getValueConverter()).convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
    }
 else {
      value=xmlCompositeDirectCollectionMapping.getValueConverter().convertDataValueToObjectValue(value,unmarshalRecord.getSession());
    }
  }
  if (value != null && value.getClass() == ClassConstants.STRING) {
    if (xmlCompositeDirectCollectionMapping.isCollapsingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().collapseStringValue((String)value);
    }
 else     if (xmlCompositeDirectCollectionMapping.isNormalizingStringValues()) {
      value=XMLConversionManager.getDefaultXMLManager().normalizeStringValue((String)value);
    }
  }
  unmarshalRecord.addAttributeValue(this,value,collection);
}