You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mu...@apache.org on 2012/07/31 12:55:41 UTC

svn commit: r1367485 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java

Author: mukulg
Date: Tue Jul 31 10:55:40 2012
New Revision: 1367485

URL: http://svn.apache.org/viewvc?rev=1367485&view=rev
Log:
committing fix for jira issue, XERCESJ-1575

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java?rev=1367485&r1=1367484&r2=1367485&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/models/XSDFACM.java Tue Jul 31 10:55:40 2012
@@ -1475,26 +1475,28 @@ public class XSDFACM
             return;
         }
         // If base has max=unbounded, then there's enough space for "need"
-        if (base.fCountingStates[d[0]].maxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED) {
-            d[2] += need;
-            if (b[2] + need > base.fCountingStates[d[0]].minOccurs) {
-                // Avoid setting count bigger than min if max is unbounded.
-                // It makes no difference. Not exceeding min means fewer
-                // distinct states, so shorter state-pairs in the list.
-                b[2] = base.fCountingStates[d[0]].minOccurs;
+        if (base.fCountingStates[d[0]] != null) {
+            if (base.fCountingStates[d[0]].maxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED) {
+                d[2] += need;
+                if (b[2] + need > base.fCountingStates[d[0]].minOccurs) {
+                    // Avoid setting count bigger than min if max is unbounded.
+                    // It makes no difference. Not exceeding min means fewer
+                    // distinct states, so shorter state-pairs in the list.
+                    b[2] = base.fCountingStates[d[0]].minOccurs;
+                }
+                else {
+                    b[2] += need;
+                }
             }
             else {
+                // If base doesn't have sufficient space, lower "need"
+                if (need > base.fCountingStates[d[0]].maxOccurs - b[2]) {
+                    need = base.fCountingStates[d[0]].maxOccurs - b[2];
+                }
                 b[2] += need;
+                d[2] += need;
             }
         }
-        else {
-            // If base doesn't have sufficient space, lower "need"
-            if (need > base.fCountingStates[d[0]].maxOccurs - b[2]) {
-                need = base.fCountingStates[d[0]].maxOccurs - b[2];
-            }
-            b[2] += need;
-            d[2] += need;
-        }
     }
     private void optimizeForAllBase(XS11AllCM base, int[] b, int[] d, int need, int indexb) {
         // Need to have seen an element, to be safe.



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