You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by "Marcus Christie (Jira)" <ji...@apache.org> on 2020/06/18 21:44:00 UTC

[jira] [Reopened] (AIRAVATA-3328) Fix Thrift/Dozer incompatibilty in Java 11

     [ https://issues.apache.org/jira/browse/AIRAVATA-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcus Christie reopened AIRAVATA-3328:
---------------------------------------

This broke some tests
{noformat}
Failed tests: 
  DataProductRepositoryTest.testDataProductWithReplicaLocation:135 null
  DataReplicaLocationRepositoryTest.dataReplicaLocationRepositoryTest:92 null
Tests in error: 
  GatewayGroupsRepositoryTest.testCreateAndRetrieveGatewayGroups:54 » Mapping ja...
  GatewayGroupsRepositoryTest.testUpdateGatewayGroups:75 » Mapping java.lang.Ill...
{noformat}

> Fix Thrift/Dozer incompatibilty in Java 11
> ------------------------------------------
>
>                 Key: AIRAVATA-3328
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-3328
>             Project: Airavata
>          Issue Type: New Feature
>          Components: Registry API
>            Reporter: Marcus Christie
>            Assignee: Marcus Christie
>            Priority: Major
>
> Thrift required fields can have a default value. This value is present in the generated models, but it is only serialized if the field has actually been set. The semantics on required fields with default values seems a little confusing.
> This causes an issue with Dozer since it has logic to only copy fields when they differ. A field on an entity will only copy to a Thrift data model field when they have the same value. If the field on the entity has the default value of the Thrift field, then it won't copy and that field will not get serialized. This then causes a validation error in Thrift since the required field wasn't set.
> This problem was initially discoverred in AIRAVATA-3268, see [this comment|https://issues.apache.org/jira/browse/AIRAVATA-3268?focusedCommentId=16978768&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16978768] and following.
> I think, as noted in [this comment|https://issues.apache.org/jira/browse/AIRAVATA-3268?focusedCommentId=16979609&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16979609], that we can create a [Dozer Custom Bean Factory|https://dozermapper.github.io/gitbook/documentation/custombeanfactories.html] to fix this.
> TODO
> - [x] Test that CustomBeanFactory does "set" required fields that have a default value
> - [x] Test that CustomBeanFactory does "set" optional fields that have a default value
> - [x] Test that ObjectMapperSingleton maps required default fields appropriately and they have a value even if there is no corresponding field on the source object. Basically this tests that the ObjectMapperSingleton is correctly configured to use the CustomBeanFactory



--
This message was sent by Atlassian Jira
(v8.3.4#803005)