[ http://issues.apache.org/jira/browse/TUSCANY-396?page=comments#action_12454910 ] Kelvin Goodson commented on TUSCANY-396: ----------------------------------------
This issue still seems to exist. I will chase the EMF bugzilla. I thought there was a fix for this. I have added a disabled test case to OpenTypeTestCase.java I will chase the EMF fix. > Cardinality of wildcard element not respected > --------------------------------------------- > > Key: TUSCANY-396 > URL: http://issues.apache.org/jira/browse/TUSCANY-396 > Project: Tuscany > Issue Type: Bug > Components: Java SDO Implementation > Affects Versions: Java-Mx > Reporter: Kelvin Goodson > Fix For: Java-Mx > > > I think there's a problem with the SDO Java setting of open content with > respect to cardinality. > Given a type ... > xsd:complexType name="OpenQuote"> > <xsd:sequence> > <xsd:element name="symbol" type="xsd:string"/> > <xsd:any namespace="##any" maxOccurs="1" /> > </xsd:sequence> > </xsd:complexType> > and a global element > <xsd:element name="note" type="xsd:string"/> > I'd expect to be able to use generated code in this way .... > OpenQuote oq = OpenFactory.INSTANCE.createOpenQuote(); > Property pc = > XSDHelper.INSTANCE.getGlobalProperty("http://www.example.com/open", "note", > true); > ((DataObject)oq).set(pc, "TBA"); > but this fails with a ClassCastException in BasicFeatureMap here .. > public void set(EStructuralFeature feature, Object object) > { > if (isMany(feature)) > { > List list = list(feature); > list.clear(); > list.addAll((Collection)object); > this is because the feature that is being tested for isMany(feature) is that > associated with the global element "note", and not the xsd:any. > The "note" element is marked as maxOccurs=unspecified, and so the set() > method expects the Object "object" to be a List. Hence in my > code above I pass in a String, and the cast of String to List unsurprisingly > fails . -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
