Author: rineholt
Date: Tue May  2 04:56:29 2006
New Revision: 398921

URL: http://svn.apache.org/viewcvs?rev=398921&view=rev
Log:
Give a little better message than NPE when a type is not found in the 
registered SDO types.

Modified:
    
incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java

Modified: 
incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java
URL: 
http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java?rev=398921&r1=398920&r2=398921&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java
 (original)
+++ 
incubator/tuscany/java/sca/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/util/AxiomHelper.java
 Tue May  2 04:56:29 2006
@@ -27,6 +27,7 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.tuscany.core.wire.InvocationRuntimeException;
 import org.apache.tuscany.sdo.helper.DataFactoryImpl;
 import org.apache.tuscany.sdo.helper.XMLHelperImpl;
 import org.apache.tuscany.sdo.helper.XSDHelperImpl;
@@ -176,6 +177,9 @@
     public static DataObject toDataObject(TypeHelper typeHelper, Object[] os, 
QName typeQN) {
         XSDHelper xsdHelper = new XSDHelperImpl(typeHelper);
         Property property = 
xsdHelper.getGlobalProperty(typeQN.getNamespaceURI(), typeQN.getLocalPart(), 
true);
+        if(null == property){
+            throw new InvocationRuntimeException("Type '" + typeQN.toString() 
+ "' not found in registered SDO types." );
+        }
         DataObject dataObject = new 
DataFactoryImpl(typeHelper).create(property.getType());
         List ips = dataObject.getInstanceProperties();
         for (int i = 0; i < ips.size(); i++) {


Reply via email to