[
https://issues.apache.org/jira/browse/TUSCANY-396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kelvin Goodson updated TUSCANY-396:
-----------------------------------
Fix Version/s: (was: Java-SCA-Mx)
Java-SDO-M3
> Cardinality of wildcard element not respected
> ---------------------------------------------
>
> Key: TUSCANY-396
> URL: https://issues.apache.org/jira/browse/TUSCANY-396
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SCA-Mx
> Reporter: Kelvin Goodson
> Fix For: Java-SDO-M3
>
>
> 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.
-
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]