axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r429690 - /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
Date Tue, 08 Aug 2006 15:30:49 GMT
Author: dims
Date: Tue Aug  8 08:30:49 2006
New Revision: 429690

URL: http://svn.apache.org/viewvc?rev=429690&view=rev
Log:
Fix for AXIS2-974 - NullPointerException in SchemaCompiler

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=429690&r1=429689&r2=429690&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
Tue Aug  8 08:30:49 2006
@@ -209,6 +209,26 @@
                 );
             }
 
+            // Fix up the imported schemas when all the schemas are
+            // defined in the same file and import each other.
+            for (int i = 0; i < schemalist.size(); i++) {
+                schema = (XmlSchema) schemalist.get(i);
+                XmlSchemaObjectCollection includes = schema.getIncludes();
+                if (includes != null) {
+                    Iterator tempIterator = includes.getIterator();
+                    while (tempIterator.hasNext()) {
+                        Object o = tempIterator.next();
+                        if (o instanceof XmlSchemaImport) {
+                            XmlSchema schema1 = ((XmlSchemaImport) o).getSchema();
+                            if (schema1 == null) {
+                                ((XmlSchemaImport) o).setSchema(
+                                        (XmlSchema) availableSchemaMap.get(((XmlSchemaImport)
o).getNamespace()));
+                            }
+                        }
+                    }
+                }
+            }
+
             //set a mapper package if not avaialable
             if (writer.getExtensionMapperPackageName()==null){
                 //get the first schema from the list and take that namespace as the
@@ -1223,7 +1243,7 @@
                     // register the mapping if we found the referenced element
                     // else throw an exception
                     if (refElement == null) {
-                        throw new SchemaCompilationException("Referenced element not found!");
+                        throw new SchemaCompilationException("Referenced element " + referencedQName
 + " not found!");
                     }
                     metainfHolder.registerMapping(referencedQName,
                             refElement.getSchemaTypeName()



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message