[ 
https://issues.apache.org/jira/browse/OLINGO-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14239468#comment-14239468
 ] 

Michael Bolz commented on OLINGO-499:
-------------------------------------

Hi [~Michael.Burwig] and [~cholzer],

sorry for the delay.

But meanwhile [~cholzer] found the problem behind this issue.
I have done a check and think the suggested solution is correct for this issue 
and [OLINGO-501].
Because a {{AbstractValue}} is either a {{Primitive}}, a {{Complex}} or a 
{{Collection}} type.
For each case {{true}} the other two types are {{false}}.
Based on that a {{Collection}} which contains {{Complex}} Properties is still 
just a collection (and {{isComplex() == false}}).
So the before suggested fix would break this (actual) behavior.
Nevertheless the _JavaDoc_ for the {{AbstractValue}} could be a little bit more 
clear on that.

tldr; The attached diff fixes this issue and [OLINGO-501] and will be pushed 
into the master.

Kind regards,
Michael


> AbstractValuable.isComplex
> --------------------------
>
>                 Key: OLINGO-499
>                 URL: https://issues.apache.org/jira/browse/OLINGO-499
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-commons, odata4-server
>    Affects Versions: (Java) V4 4.0.0-beta-02
>            Reporter: Ole Lilienthal
>            Assignee: Michael Bolz
>            Priority: Critical
>              Labels: easyfix
>         Attachments: Olingo499.diff
>
>
> org.apache.olingo.commons.core.data.AbstractValuable.isComplex() returns 
> false for org.apache.olingo.commons.api.data.ValueType.COLLECTION_COMPLEX.
> It should rather be:
> return (valueType == ValueType.COMPLEX || valueType.getBaseType() == 
> ValueType.COMPLEX);
> Otherwise there is a contradiction in the function: 
> org.apache.olingo.server.core.serializer.json.ODataJsonSerializer.writeComplexCollection
> The switch checks the value type to be COLLECTION_COMPLEX and wants to use 
> the property.asComplex which currently always returns null due to the wrong 
> isComplex implementation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to