Program: 64917
Project: 64917
Buggy source:
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if (null == value) {
    return;
  }
  if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    if (unmarshalRecord.isNil()) {
      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);
  }
  Converter valueConverter=xmlCompositeDirectCollectionMapping.getValueConverter();
  if (null != valueConverter) {
    if (valueConverter instanceof XMLConverter) {
      value=((XMLConverter)valueConverter).convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
    }
 else {
      value=valueConverter.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 (unmarshalRecord.isNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    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);
  }
  Converter valueConverter=xmlCompositeDirectCollectionMapping.getValueConverter();
  if (null != valueConverter) {
    if (valueConverter instanceof XMLConverter) {
      value=((XMLConverter)valueConverter).convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
    }
 else {
      value=valueConverter.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);
}