Abstract Static Base Types mixed with Dynamic Extended Types
------------------------------------------------------------

                 Key: TUSCANY-1540
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1540
             Project: Tuscany
          Issue Type: Bug
          Components: Java SDO Implementation
    Affects Versions: Java-SDO-1.0
            Reporter: Murtaza Goga
             Fix For: Java-SDO-Next


Setting a property on a static data object with an object of a type extended in 
a dynamic model results in a ClassCastException.

Scenario:
Static schema-
  <xsd:complexType name="CustomerType">
    <xsd:all>
      <xsd:element name="number" type="xsd:integer" />
      <xsd:element form="unqualified" name="info" type="InfoType" />
    </xsd:all>
  </xsd:complexType>
        
  <xsd:complexType name="InfoType" abstract="true"/>

Dynamic Schema
<xsd:complexType name="InfoType">
  <xsd:complexContent>
    <xsd:extension base="staticNS:InfoType">
      <xsd:sequence>
        <xsd:element name="zipcode" type="xsd:string" />
      </xsd:sequence>
    </xsd:extension>
  </xsd:complexContent>
</xsd:complexType>


The following will fail:
DataFactory factory = scope.getDataFactory();
factory.create(CustomerType.class).setDataObject("info", 
factory.create("dynamicNS", "InfoType"));

It should be legal to assign a property to an object if they are in the same 
hierachy.

Steps to reproduce within Tuscany:
Testcase org.apache.tuscany.sdo.test.ExtensibleTestCase will break if 
'InfoType' defined in extensible/customer.xsd  is marked as abstract.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to