Author: mriou
Date: Wed Jun 11 16:04:15 2008
New Revision: 666883
URL: http://svn.apache.org/viewvc?rev=666883&view=rev
Log:
'Null model' is not the most explicit error.
Modified:
ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java
Modified:
ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java?rev=666883&r1=666882&r2=666883&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
(original)
+++
ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
Wed Jun 11 16:04:15 2008
@@ -115,6 +115,7 @@
import org.apache.ode.utils.stl.UnaryFunction;
import org.apache.ode.utils.xsd.XSUtils;
import org.apache.ode.utils.xsd.XsdException;
+import org.apache.ode.utils.xsd.SchemaModel;
import org.apache.xerces.xni.parser.XMLEntityResolver;
import org.w3c.dom.Node;
@@ -406,8 +407,13 @@
public OXsdTypeVarType resolveXsdType(QName typeName) throws
CompilationException {
OXsdTypeVarType type = _oprocess.xsdTypes.get(typeName);
if (type == null) {
- if (!_wsdlRegistry.getSchemaModel().knowsSchemaType(typeName))
+ SchemaModel model = null;
+ try {
+ model = _wsdlRegistry.getSchemaModel();
+ } catch (IllegalArgumentException iaa) { }
+ if (model == null || !model.knowsSchemaType(typeName))
throw new
CompilationException(__cmsgs.errUndeclaredXsdType(typeName));
+
type = new OXsdTypeVarType(_oprocess);
type.debugInfo = createDebugInfo(_processDef, "XSD Type: " +
typeName);
type.xsdType = typeName;
Modified:
ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java?rev=666883&r1=666882&r2=666883&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java
(original)
+++
ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java
Wed Jun 11 16:04:15 2008
@@ -50,10 +50,7 @@
private XSModel _model;
private SchemaModelImpl(XSModel model) {
- if (model == null) {
- throw new NullPointerException("Null model.");
- }
-
+ if (model == null) throw new IllegalArgumentException("Null model.");
_model = model;
}