Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1167

Pojogen fails when resource has same name as primitive type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • (Java) V4 4.2.0, (Java) V4 4.3.0
    • (Java) V4 4.10.0
    • odata4-commons, odata4-ext
    • None
    • EntityType with same name as EdmPrimitiveTypeKind. For instance: Binary

    Description

      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. Take the following scenario:
      $metadata

      ...
      <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>
      ...
      

      My self.edu.Binary resource match with the primitive kind Edm.Binary due to the check in EdmTypeInfo.java:

      this.primitiveType = EdmPrimitiveTypeKind.valueOf(this.fullQualifiedName.getName());

      When the code generator tries to access the type of the entity it throws a NullPointerException.

      Attachments

        Issue Links

          Activity

            People

              mirbo mibo
              lynx Simon Ammer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified