lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r891889 - in /lucene/solr/trunk: CHANGES.txt src/java/org/apache/solr/analysis/BufferedTokenStream.java src/test/org/apache/solr/analysis/TestBufferedTokenStream.java
Date Thu, 17 Dec 2009 20:47:56 GMT
Author: shalin
Date: Thu Dec 17 20:47:56 2009
New Revision: 891889

URL: http://svn.apache.org/viewvc?rev=891889&view=rev
Log:
SOLR-1662 -- Added Javadocs in BufferedTokenStream and fixed incorrect cloning in TestBufferedTokenStream

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/analysis/BufferedTokenStream.java
    lucene/solr/trunk/src/test/org/apache/solr/analysis/TestBufferedTokenStream.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=891889&r1=891888&r2=891889&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Thu Dec 17 20:47:56 2009
@@ -169,6 +169,9 @@
 
 * SOLR-1637: Remove ALIAS command
 
+* SOLR-1662: Added Javadocs in BufferedTokenStream and fixed incorrect cloning
+  in TestBufferedTokenStream (Robert Muir, Uwe Schindler via shalin)
+
 Build
 ----------------------
 

Modified: lucene/solr/trunk/src/java/org/apache/solr/analysis/BufferedTokenStream.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/analysis/BufferedTokenStream.java?rev=891889&r1=891888&r2=891889&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/analysis/BufferedTokenStream.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/analysis/BufferedTokenStream.java Thu Dec 17
20:47:56 2009
@@ -46,13 +46,16 @@
  *   public MyTokenStream(TokenStream input) {super(input);}
  *   protected Token process(Token t) throws IOException {
  *     if ("A".equals(t.termText()) && "B".equals(peek(1).termText()))
- *       write(t);
+ *       write((Token)t.clone());
  *     return t;
  *   }
  * }
  * </pre>
  *
- *
+ * NOTE: BufferedTokenStream does not clone() any Tokens. This is instead the 
+ * responsibility of the implementing subclass. In the "A" "B" => "A" "A" "B"
+ * example above, the subclass must clone the additional "A" it creates.
+ * 
  * @version $Id$
  */
 public abstract class BufferedTokenStream extends TokenFilter {

Modified: lucene/solr/trunk/src/test/org/apache/solr/analysis/TestBufferedTokenStream.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/org/apache/solr/analysis/TestBufferedTokenStream.java?rev=891889&r1=891888&r2=891889&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/org/apache/solr/analysis/TestBufferedTokenStream.java (original)
+++ lucene/solr/trunk/src/test/org/apache/solr/analysis/TestBufferedTokenStream.java Thu Dec
17 20:47:56 2009
@@ -50,7 +50,7 @@
     protected Token process(Token t) throws IOException {
       if ("A".equals(new String(t.termBuffer(), 0, t.termLength())) && 
           "B".equals(new String(peek(1).termBuffer(), 0, peek(1).termLength())))
-        write(t);
+        write((Token)t.clone());
       return t;
     }
   }



Mime
View raw message