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

mibo reassigned OLINGO-1167:
----------------------------

    Assignee: mibo

> Pojogen fails when resource has same name as primitive type
> -----------------------------------------------------------
>
>                 Key: OLINGO-1167
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1167
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-commons, odata4-ext
>    Affects Versions: (Java) V4 4.2.0, (Java) V4 4.3.0
>         Environment: EntityType with same name as EdmPrimitiveTypeKind. For 
> instance: Binary
>            Reporter: Simon Ammer
>            Assignee: mibo
>            Priority: Critical
>             Fix For: (Java) V4 4.10.0
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> At some parts Olingo does not use the fully qualified name of a resource to 
> reference it.Therefore _pojogen_ fails when you have a resource with the same 
> name as a value defined in 
> [EdmPrimitiveTypeKind.java|https://github.com/apache/olingo-odata4/blob/6bc17b668c16bbf96458c996bb9d9a768c74dc98/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeKind.java].
>  Take the following scenario:
> *$metadata*
> {code:xml}
> ...
> <EntityType Name="Binary">
>   <Property Name="asset" Type="Edm.Int64"/>
>   <Property Name="version" Type="Edm.Int64"/>
>   <Property Name="type" Type="Edm.String"/>
>   <Property Name="format" Type="Edm.String"/>
> </EntityType>
> ...
> {code}
> My {{self.edu.Binary}} resource match with the primitive kind {{Edm.Binary}} 
> due to the check in 
> [EdmTypeInfo.java|https://github.com/apache/olingo-odata4/blob/4a51d16425144a7de0be0f9dcd01c667bed322df/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java#L107]:
> {code:java}this.primitiveType = 
> EdmPrimitiveTypeKind.valueOf(this.fullQualifiedName.getName());{code}
> When the code generator tries to access the type of the entity it throws a 
> NullPointerException.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to