You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Kevin Ratnasekera (JIRA)" <ji...@apache.org> on 2015/04/17 02:46:58 UTC
[jira] [Updated] (OLINGO-630) Exception is thrown when serializing
the complex type properties of entities in Car/manufacturer example Service
( serializing Manufacturer entities having Address complex type property)
[ https://issues.apache.org/jira/browse/OLINGO-630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Ratnasekera updated OLINGO-630:
-------------------------------------
Attachment: complex_type_serialization_exception_car_manufacturer_example.patch
> Exception is thrown when serializing the complex type properties of entities in Car/manufacturer example Service ( serializing Manufacturer entities having Address complex type property)
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OLINGO-630
> URL: https://issues.apache.org/jira/browse/OLINGO-630
> Project: Olingo
> Issue Type: Bug
> Components: odata4-server
> Affects Versions: (Java) V4 4.0.0-beta-03
> Reporter: Kevin Ratnasekera
> Priority: Trivial
> Attachments: complex_type_serialization_exception_car_manufacturer_example.patch
>
>
> java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.apache.olingo.commons.api.data.ComplexValue exception is thrown in the ODataSerializer method
> writeComplexValue((EdmComplexType) edmProperty.getType(), property.asComplex().getValue(),selectedPaths, json);
> Root cause for the issue is when invoking
> property.asComplex()
> public ComplexValue asComplex() {
> if(isCollection()) {
> return null;
> }
> return isComplex() ? (ComplexValue) value : null;
> }
> here the value Object is first initialized to List<Property> at the Car/manufacturer Service later it is being casted to ComplexValue.
> Herewith attached a patch, proper type is set to value Object, so that no cast exaception is thrown later when serializing complex types.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)