Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1156

CodeGen generates lowercase feature name when the schema specifies uppercase

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Java-SCA-M2
    • Java-SDO-beta1
    • Java SDO Tools
    • None
    • All
    • Patch Available

    Description

      When the schema is let us say the following

      <xsd:element name="HolderDetail" type="tns:HolderDetail"/>
      <xsd:complexType name="HolderDetail">
      <xsd:all>
      <xsd:element name="ID" type="xsd:string"/>
      </xsd:all>
      </xsd:complexType>

      The codegen tool generates the name for the feature "ID" in lower case i.e "id". Hence when we use the DataObject.setString("ID","value"), it throws the following exception because it could not find the feature ID.

      Caused by: java.lang.IllegalArgumentException: Class 'HolderDetail' does not have a feature named 'ID'
      at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.setFeatureName(DataObjectUtil.java:2069)
      at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.process(DataObjectUtil.java:2211)
      at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.init(DataObjectUtil.java:1941)
      at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUtil.java:1858)
      at org.apache.tuscany.sdo.util.DataObjectUtil.setString(DataObjectUtil.java:474)
      at org.apache.tuscany.sdo.impl.DataObjectImpl.setString(DataObjectImpl.java:566)

      Attachments

        1. example1156.zip
          6 kB
          David T. Adcox
        2. 1156.patch
          4 kB
          David T. Adcox

        Activity

          People

            Unassigned Unassigned
            asundar Hasan Muhammad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: