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

Ole Lilienthal updated OLINGO-499:
----------------------------------
    Description: 
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.


  was:
isComplex() returns false for ValueType.COLLECTION_COMPLEX.
It should rather be:
return (valueType == ValueType.COMPLEX || valueType.getBaseType() == 
ValueType.COMPLEX);

Otherwise there is a contradiction in the function: 
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.



> 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
>            Priority: Critical
>              Labels: easyfix
>
> 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