Author: mrglavas
Date: Tue Sep 22 04:00:52 2009
New Revision: 817494

URL: http://svn.apache.org/viewvc?rev=817494&view=rev
Log:
Reduce the cost of reset(). If we end up having to read from the component 
manager more than once make sure that we use a cached default value for the 
SchemaDVFactory if one was not explicitly provided. This eliminates repeated 
calls to SchemaDVFactory.getInstance() which can be very expensive.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java?rev=817494&r1=817493&r2=817494&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java 
(original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java Tue 
Sep 22 04:00:52 2009
@@ -37,7 +37,6 @@
 import org.apache.xerces.impl.Constants;
 import org.apache.xerces.impl.XMLEntityManager;
 import org.apache.xerces.impl.XMLErrorReporter;
-import org.apache.xerces.impl.dv.DVFactoryException;
 import org.apache.xerces.impl.dv.InvalidDatatypeValueException;
 import org.apache.xerces.impl.dv.SchemaDVFactory;
 import org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl;
@@ -250,6 +249,7 @@
     private SubstitutionGroupHandler fSubGroupHandler;
     private CMBuilder fCMBuilder;
     private XSDDescription fXSDDescription = new XSDDescription();
+    private SchemaDVFactory fDefaultSchemaDVFactory;
     
     private WeakHashMap fJAXPCache;
     private Locale fLocale = Locale.getDefault();
@@ -985,7 +985,10 @@
         } catch (XMLConfigurationException e) {
         }
         if (dvFactory == null) {
-            dvFactory = SchemaDVFactory.getInstance();
+            if (fDefaultSchemaDVFactory == null) {
+                fDefaultSchemaDVFactory = SchemaDVFactory.getInstance();
+            }
+            dvFactory = fDefaultSchemaDVFactory;
         }
         fSchemaHandler.setDVFactory(dvFactory);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to