You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/05/14 05:21:01 UTC

svn commit: r656091 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs: XMLSchemaLoader.java XSLoaderImpl.java util/XSGrammarPool.java

Author: mrglavas
Date: Tue May 13 20:21:01 2008
New Revision: 656091

URL: http://svn.apache.org/viewvc?rev=656091&view=rev
Log:
If the XSGrammarPool is empty or if an empty list is passed to the the XSLoader
return an XSModel which contains the built-in types instead of returning null.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSLoaderImpl.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSGrammarPool.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java?rev=656091&r1=656090&r2=656091&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java Tue May 13 20:21:01 2008
@@ -1093,13 +1093,10 @@
     }
     
     /* (non-Javadoc)
-     * @see org.apache.xerces.xs.XSLoader#loadInputList(org.apache.xerces.xs.DOMInputList)
+     * @see org.apache.xerces.xs.XSLoader#loadInputList(org.apache.xerces.xs.LSInputList)
      */
     public XSModel loadInputList(LSInputList is) {
         int length = is.getLength();
-        if (length == 0) {
-            return null;
-        }
         SchemaGrammar[] gs = new SchemaGrammar[length];
         for (int i = 0; i < length; i++) {
             try {
@@ -1131,9 +1128,6 @@
      */
     public XSModel loadURIList(StringList uriList) {
         int length = uriList.getLength();
-        if (length == 0) {
-            return null;
-        }
         SchemaGrammar[] gs = new SchemaGrammar[length];
         for (int i = 0; i < length; i++) {
             try {

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSLoaderImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSLoaderImpl.java?rev=656091&r1=656090&r2=656091&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSLoaderImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSLoaderImpl.java Tue May 13 20:21:01 2008
@@ -100,9 +100,6 @@
      */
     public XSModel loadURIList(StringList uriList) {
         int length = uriList.getLength();
-        if (length == 0) {
-            return null;
-        }
         try {
             fGrammarPool.clear();
             for (int i = 0; i < length; ++i) {
@@ -125,9 +122,6 @@
      */
     public XSModel loadInputList(LSInputList is) {
         final int length = is.getLength();
-        if (length == 0) {
-            return null;
-        }
         try {
             fGrammarPool.clear();
             for (int i = 0; i < length; ++i) {

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSGrammarPool.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSGrammarPool.java?rev=656091&r1=656090&r2=656091&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSGrammarPool.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSGrammarPool.java Tue May 13 20:21:01 2008
@@ -34,6 +34,7 @@
  * @version $Id$
  */
 public class XSGrammarPool extends XMLGrammarPoolImpl {
+    
     /**
      * Return an <code>XSModel</code> that represents components in
      * the schema grammars in this pool implementation.
@@ -48,14 +49,12 @@
                     list.add(entry.grammar);
             }
         }
-
         int size = list.size();
         if (size == 0) {
-            return null;
+            return new XSModelImpl(new SchemaGrammar[0]);
         }
         SchemaGrammar[] gs = (SchemaGrammar[])list.toArray(new SchemaGrammar[size]);
         return new XSModelImpl(gs);
     }
 
-
 } // class XSGrammarPool



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