Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Java-SDO-1.0
-
None
Description
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.
Attachments
Attachments
Issue Links
- is related to
-
TUSCANY-513 Implement support for dynamic subclasses of statically generated types
- Closed