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 2007/09/02 20:40:40 UTC

svn commit: r572107 - in /xerces/java/trunk/src/org/apache/xerces/impl/xpath: XPath.java XPathException.java

Author: mrglavas
Date: Sun Sep  2 11:40:40 2007
New Revision: 572107

URL: http://svn.apache.org/viewvc?rev=572107&view=rev
Log:
Marking several fields final.

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPath.java
    xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPathException.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPath.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPath.java?rev=572107&r1=572106&r2=572107&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPath.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPath.java Sun Sep  2 11:40:40 2007
@@ -51,13 +51,13 @@
     //
 
     /** Expression. */
-    protected String fExpression;
+    protected final String fExpression;
 
     /** Symbol table. */
-    protected SymbolTable fSymbolTable;
+    protected final SymbolTable fSymbolTable;
 
     /** Location paths. */
-    protected LocationPath[] fLocationPaths;
+    protected final LocationPath[] fLocationPaths;
 
     //
     // Constructors
@@ -69,7 +69,10 @@
         throws XPathException {
         fExpression = xpath;
         fSymbolTable = symbolTable;
-        parseExpression(context);
+        fLocationPaths = parseExpression(context);
+        if (DEBUG_XPATH_PARSE) {
+            System.out.println(">>> "+fLocationPaths);
+        }
     } // <init>(String,SymbolTable,NamespaceContext)
 
     //
@@ -143,7 +146,7 @@
      * This method is implemented by using the XPathExprScanner and
      * examining the list of tokens that it returns.
      */
-    private void parseExpression(final NamespaceContext context)
+    private LocationPath[] parseExpression(final NamespaceContext context)
         throws XPathException {
 
         // tokens
@@ -307,13 +310,8 @@
 
         locationPathsVector.add(buildLocationPath(stepsVector));
 
-        // save location path
-        fLocationPaths = (LocationPath[])locationPathsVector.toArray(new LocationPath[locationPathsVector.size()]);
-
-
-        if (DEBUG_XPATH_PARSE) {
-            System.out.println(">>> "+fLocationPaths);
-        }
+        // return location path
+        return (LocationPath[])locationPathsVector.toArray(new LocationPath[locationPathsVector.size()]);
 
     } // parseExpression(SymbolTable,NamespaceContext)
 
@@ -376,7 +374,7 @@
         //
 
         /** List of steps. */
-        public Step[] steps;
+        public final Step[] steps;
 
         //
         // Constructors
@@ -443,10 +441,10 @@
         //
 
         /** Axis. */
-        public Axis axis;
+        public final Axis axis;
 
         /** Node test. */
-        public NodeTest nodeTest;
+        public final NodeTest nodeTest;
 
         //
         // Constructors
@@ -523,7 +521,7 @@
         //
 
         /** Axis type. */
-        public short type;
+        public final short type;
 
         //
         // Constructors
@@ -592,7 +590,7 @@
         //
 
         /** Node test type. */
-        public short type;
+        public final short type;
 
         /** Node qualified name. */
         public final QName name = new QName();

Modified: xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPathException.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPathException.java?rev=572107&r1=572106&r2=572107&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPathException.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xpath/XPathException.java Sun Sep  2 11:40:40 2007
@@ -35,7 +35,7 @@
     // Data
 
     // hold the value of the key this Exception refers to.
-    private String fKey;
+    private final String fKey;
     //
     // Constructors
     //



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