[dna-commits] DNA SVN: r1184 - trunk/dna-common/src/main/java/org/jboss/dna/common/text.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Wed Sep 2 14:06:07 EDT 2009


Author: rhauch
Date: 2009-09-02 14:06:06 -0400 (Wed, 02 Sep 2009)
New Revision: 1184

Modified:
   trunk/dna-common/src/main/java/org/jboss/dna/common/text/TokenStream.java
Log:
Added a toString() method to the Token implementations to make debugging easier.  Also changed a LinkedList to an ArrayList for the same reason.

Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/text/TokenStream.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/text/TokenStream.java	2009-09-02 18:05:46 UTC (rev 1183)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/text/TokenStream.java	2009-09-02 18:06:06 UTC (rev 1184)
@@ -23,8 +23,8 @@
  */
 package org.jboss.dna.common.text;
 
+import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
@@ -1071,6 +1071,16 @@
         protected String matchString() {
             return inputString;
         }
+
+        /**
+         * {@inheritDoc}
+         * 
+         * @see java.lang.Object#toString()
+         */
+        @Override
+        public String toString() {
+            return value();
+        }
     }
 
     @Immutable
@@ -1093,7 +1103,7 @@
     }
 
     protected abstract class TokenFactory implements Tokens {
-        protected final List<Token> tokens = new LinkedList<Token>();
+        protected final List<Token> tokens = new ArrayList<Token>();
 
         /**
          * {@inheritDoc}



More information about the dna-commits mailing list