mrglavas    2005/02/10 09:07:54

  Modified:    java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
  Log:
  If an instance document contains many errors we could be spending a great 
deal of time
  resizing the vector which stores error codes.  Allow this vector to manage 
its size better.
  Also, we only read the vector when we're augmenting PSVI so we can avoid the
  addElement calls if this feature is off.
  
  Revision  Changes    Path
  1.166     +8 -4      
xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
  
  Index: XMLSchemaValidator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
  retrieving revision 1.165
  retrieving revision 1.166
  diff -u -r1.165 -r1.166
  --- XMLSchemaValidator.java   9 Feb 2005 15:34:02 -0000       1.165
  +++ XMLSchemaValidator.java   10 Feb 2005 17:07:54 -0000      1.166
  @@ -319,7 +319,7 @@
   
           // store error codes; starting position of the errors for each 
element;
           // number of element (depth); and whether to record error
  -        Vector fErrors = new Vector(INITIAL_STACK_SIZE, INC_STACK_SIZE);
  +        Vector fErrors = new Vector();
           int[] fContext = new int[INITIAL_STACK_SIZE];
           int fContextCount;
   
  @@ -393,7 +393,9 @@
           public void reportError(String domain, String key, Object[] 
arguments, short severity)
               throws XNIException {
               fErrorReporter.reportError(domain, key, arguments, severity);
  -            fErrors.addElement(key);
  +            if (fAugPSVI) {
  +                fErrors.addElement(key);
  +            }
           } // reportError(String,String,Object[],short)
   
           public void reportError(
  @@ -404,7 +406,9 @@
               short severity)
               throws XNIException {
               fErrorReporter.reportError(location, domain, key, arguments, 
severity);
  -            fErrors.addElement(key);
  +            if (fAugPSVI) {
  +                fErrors.addElement(key);
  +            }
           } // reportError(XMLLocator,String,String,Object[],short)
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to