You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Michael Bolz (JIRA)" <ji...@apache.org> on 2014/11/27 06:37:12 UTC
[jira] [Commented] (OLINGO-499) AbstractValuable.isComplex
[ https://issues.apache.org/jira/browse/OLINGO-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14227283#comment-14227283 ]
Michael Bolz commented on OLINGO-499:
-------------------------------------
Hi [~Lilienthal],
I take a look into and think following solution could be a little bit more clear:
{code}
@Override
public boolean isComplex() {
if(isCollection()) {
return valueType.getBaseType() != null && valueType.getBaseType() == ValueType.COMPLEX;
}
return valueType == ValueType.COMPLEX;
}
{code}
But this is nearly the same as your solution ;o)
I will do some re-check and then push the fix.
Thanks for finding it.
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
>
> 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)