You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org> on 2006/12/01 18:08:24 UTC
[jira] Resolved: (TUSCANY-396) Cardinality of wildcard element not
respected
[ http://issues.apache.org/jira/browse/TUSCANY-396?page=all ]
Kelvin Goodson resolved TUSCANY-396.
------------------------------------
Resolution: Fixed
> 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org