[
https://issues.apache.org/jira/browse/TUSCANY-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509652
]
Fuhwei Lwo commented on TUSCANY-477:
------------------------------------
Possible solution is to modify BaseSDOXSDEcoreBuild.java to the follow snippet
to throw IllegalArgumentException when the simple and complext type XSD
definition cannot be found.
else if (xsdSimpleTypeDefinition.getContainer() == null)
{
// return
(EDataType)getBuiltInEClassifier(rootSchema.getSchemaForSchemaNamespace(),
"anySimpleType");
throw new IllegalArgumentException();
}
The exception handling/serviceability of XSDHelper.define() is not well defined
in the SDO 2.1 spec. I don't think current behavior is breaking the spec. Also,
merely throwing an IllegalArgumentException is not good enough because the SDO
users may like to know what's wrong with their XSD.
I suggest to keep the current behavior for Tuscany SDO 1.0 release for now.
Fuhwei
> SDO runtime should report unresolved types in a meaningful way if
> xsd:import/include cannot be resolved
> -------------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-477
> URL: https://issues.apache.org/jira/browse/TUSCANY-477
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SCA-M2
> Reporter: Raymond Feng
> Assignee: Frank Budinsky
> Priority: Minor
> Fix For: Java-SDO-Next
>
> Attachments: patch&tests.zip, TestXSDImport.jar
>
>
> I'm seeing different behaviors from XSDHelper.define() if the
> xsd:import/include cannot be resolved. I wonder if we should have a
> consistent error handling here. Please see the attached test case (in the
> case, I pass null as schemaLocation to the define() on purpose).
> Case 1: Unresolved XSD type is silently replaced by Object DataType
> Case 2: IllegalArgumentException is thrown due to a NPE in EMF code
--
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]