xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject svn commit: r693489 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
Date Tue, 09 Sep 2008 15:40:16 GMT
Author: mrglavas
Date: Tue Sep  9 08:40:15 2008
New Revision: 693489

URL: http://svn.apache.org/viewvc?rev=693489&view=rev
Log:
Fixing a potential NPE. The Javadoc for XMLGrammarPool.retrieveInitialGrammarSet() doesn't
explicitly disallow null as a return value. It's possible that some user implementations will
return null.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.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=693489&r1=693488&r2=693489&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 Sep  9 08:40:15 2008
@@ -1057,7 +1057,8 @@
     private void initGrammarBucket(){
         if(fGrammarPool != null) {
             Grammar [] initialGrammars = fGrammarPool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA);
-            for (int i = 0; i < initialGrammars.length; i++) {
+            final int length = (initialGrammars != null) ? initialGrammars.length : 0;
+            for (int i = 0; i < length; ++i) {
                 // put this grammar into the bucket, along with grammars
                 // imported by it (directly or indirectly)
                 if (!fGrammarBucket.putGrammar((SchemaGrammar)(initialGrammars[i]), true))
{



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


Mime
View raw message