[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-cvs
Subject:    svn commit: r122873 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemC
From:       kkrouse () apache ! org
Date:       2004-12-20 20:03:54
Message-ID: 20041220200354.67658.qmail () minotaur ! apache ! org
[Download RAW message or body]

Author: kkrouse
Date: Mon Dec 20 12:03:52 2004
New Revision: 122873

URL: http://svn.apache.org/viewcvs?view=rev&rev=122873
Log:
added null check

Modified:
   xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java


Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java
                
Url: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/imp \
l/schema/SchemaTypeSystemCompiler.java?view=diff&rev=122873&p1=xmlbeans/trunk/src/type \
impl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java&r1=122872&p2=xmlbea \
ns/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java&r2=122873
 ==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java	(original)
                
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java	Mon \
Dec 20 12:03:52 2004 @@ -198,14 +198,17 @@
         options = XmlOptions.maskNull(options);
         ArrayList schemas = new ArrayList();
 
-        for (int i = 0; i < input.length; i++)
+        if (input != null)
         {
-            if (input[i] instanceof Schema)
-                schemas.add(input[i]);
-            else if (input[i] instanceof SchemaDocument && \
                ((SchemaDocument)input[i]).getSchema() != null)
-                schemas.add(((SchemaDocument)input[i]).getSchema());
-            else
-                throw new XmlException("Thread " + Thread.currentThread().getName() \
+  ": The " + i + "th supplied input is not a schema or a config document: its type \
is " + input[i].schemaType()); +            for (int i = 0; i < input.length; i++)
+            {
+                if (input[i] instanceof Schema)
+                    schemas.add(input[i]);
+                else if (input[i] instanceof SchemaDocument && \
((SchemaDocument)input[i]).getSchema() != null) +                    \
schemas.add(((SchemaDocument)input[i]).getSchema()); +                else
+                    throw new XmlException("Thread " + \
Thread.currentThread().getName() +  ": The " + i + "th supplied input is not a schema \
or a config document: its type is " + input[i].schemaType()); +            }
         }
 
         Collection userErrors = (Collection)options.get(XmlOptions.ERROR_LISTENER);
@@ -398,7 +401,7 @@
     /**
      * Generate java source files for a SchemaTypeSystem.
      * Please do not invoke this method directly as the signature could change \
                unexpectedly.
-     * Use {@link org.apache.xmlbeans.XmlBeans#compileXmlBeans(String, \
org.apache.xmlbeans.SchemaTypeSystem, org.apache.xmlbeans.XmlObject[], \
org.apache.xmlbeans.BindingConfig, org.apache.xmlbeans.SchemaTypeLoader, \
org.apache.xmlbeans.Filer, org.apache.xmlbeans.XmlOptions)} instead. +     * Use \
                {@link org.apache.xmlbeans.XmlBeans#compileXmlBeans}
      *
      * @param system the SchemaTypeSystem to generated java source for
      * @param filer to create the java source files

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic