You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/09/29 06:06:32 UTC

svn commit: r699981 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/DOMParserImpl.java

Author: mrglavas
Date: Sun Sep 28 21:06:31 2008
New Revision: 699981

URL: http://svn.apache.org/viewvc?rev=699981&view=rev
Log:
Eliminating an unnecessary field. There's no value in caching 
the list that is used in setParameter() for collecting schema
locations. Most sensibly written applications will configure 
the parser only once, in which case this list would be used at 
most once.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/DOMParserImpl.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/DOMParserImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/DOMParserImpl.java?rev=699981&r1=699980&r2=699981&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/DOMParserImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/DOMParserImpl.java Sun Sep 28 21:06:31 2008
@@ -22,7 +22,6 @@
 import java.util.Locale;
 import java.util.Stack;
 import java.util.StringTokenizer;
-import java.util.Vector;
 
 import org.apache.xerces.dom.DOMErrorImpl;
 import org.apache.xerces.dom.DOMMessageFormatter;
@@ -140,7 +139,6 @@
 
     protected final static boolean DEBUG = false;
 
-    private final Vector fSchemaLocations = new Vector();
     private String fSchemaLocation = null;
 	private DOMStringList fRecognizedParameters;
     
@@ -283,18 +281,17 @@
      * @throws SAXException Thrown on initialization error.
      */
     public void reset () {
-        super.reset ();
+        super.reset();
         
         // get state of namespace-declarations parameter.
         fNamespaceDeclarations = 
             fConfiguration.getFeature(Constants.DOM_NAMESPACE_DECLARATIONS);
                 
         // DOM Filter
-        if (fSkippedElemStack!=null) {
-            fSkippedElemStack.removeAllElements ();
+        if (fSkippedElemStack != null) {
+            fSkippedElemStack.removeAllElements();
         }
-        fSchemaLocations.clear ();
-        fRejectedElement.clear ();
+        fRejectedElement.clear();
         fFilterReject = false;
         fSchemaType = null;
 
@@ -490,15 +487,15 @@
                             // map DOM schema-location to JAXP schemaSource property
                             // tokenize location string
                             StringTokenizer t = new StringTokenizer (fSchemaLocation, " \n\t\r");
-                            if (t.hasMoreTokens ()){
-                                fSchemaLocations.clear ();
-                                fSchemaLocations.add (t.nextToken ());
-                                while (t.hasMoreTokens ()) {
-                                    fSchemaLocations.add (t.nextToken ());
+                            if (t.hasMoreTokens()) {
+                                ArrayList locations = new ArrayList();
+                                locations.add (t.nextToken());
+                                while (t.hasMoreTokens()) {
+                                    locations.add (t.nextToken());
                                 }
                                 fConfiguration.setProperty (
                                 Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE,
-                                fSchemaLocations.toArray ());
+                                locations.toArray ());
                             }
                             else {
                                 fConfiguration.setProperty (



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