You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by ce...@apache.org on 2004/06/23 23:33:00 UTC
cvs commit: xml-xmlbeans/v1/src/typeimpl/org/apache/xmlbeans/impl/schema SchemaTypeVisitorImpl.java
cezar 2004/06/23 14:33:00
Modified: v1/src/typeimpl/org/apache/xmlbeans/impl/schema
SchemaTypeVisitorImpl.java
Log:
Vaidation optimization for JIRA bug XMLBEANS-37.
DRT: passes
Revision Changes Path
1.5 +20 -1 xml-xmlbeans/v1/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeVisitorImpl.java
Index: SchemaTypeVisitorImpl.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v1/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeVisitorImpl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SchemaTypeVisitorImpl.java 12 Feb 2004 20:05:55 -0000 1.4
+++ SchemaTypeVisitorImpl.java 23 Jun 2004 21:32:59 -0000 1.5
@@ -317,8 +317,25 @@
if (!prepare())
return notValid();
+ // init with some values out of processedChildCount and stackSize range
+ int lastAtProcessedChildCount = -2;
+ int lastAtStackSize = -2;
+
traversing: for (;;)
{
+ // optimization for cases where state doesn't change between _top._curMin and _top._curMax
+ // check for state change see JIRA bug XMLBEANS-37
+ if (_top._curCount>_top._curMin &&
+ lastAtProcessedChildCount==_top._processedChildCount &&
+ lastAtStackSize==_stackSize)
+ {
+ _top._curCount = _top._curMax;
+ }
+
+ // save state
+ lastAtProcessedChildCount = _top._processedChildCount;
+ lastAtStackSize = _stackSize;
+
while (_top._curCount >= _top._curMax)
{
if (!pop())
@@ -369,8 +386,10 @@
}
_top._curCount++;
_top._processedChildCount = 0;
+
continue traversing;
+
case SchemaParticle.CHOICE:
for (int i = 0; i < _top._childCount; i++)
{
@@ -469,7 +488,7 @@
public SchemaField get_schema_field() {
if (currentParticle() instanceof SchemaField)
return (SchemaField)currentParticle();
-
+
return null;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org