Program: 65894
Project: 65894
Buggy source:
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if (null == value) {
    return;
  }
  if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(unmarshalRecord.getAttributes())) {
    return;
  }
  if ((!isWhitespaceAware() && XMLConstants.EMPTY_STRING.equals(value))) {
    return;
  }
  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());
    }
  }
  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=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());
    }
  }
  unmarshalRecord.addAttributeValue(this,value,collection);
}