lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r769531 - in /lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src: java/org/apache/lucene/analysis/tokenattributes/ test/org/apache/lucene/analysis/ test/org/apache/lucene/index/ test/org/apache/lucene/queryParser/ test/org/apache/lu...
Date Tue, 28 Apr 2009 20:55:31 GMT
Author: mikemccand
Date: Tue Apr 28 20:55:28 2009
New Revision: 769531

URL: http://svn.apache.org/viewvc?rev=769531&view=rev
Log:
LUCENE-1616: back compat fixes for switch to single setOffset API

Modified:
    lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttribute.java
    lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
    lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/index/TestTermVectorsReader.java
    lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java
    lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestQueryParser.java
    lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/search/TestPositionIncrement.java

Modified: lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttribute.java
URL: http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttribute.java?rev=769531&r1=769530&r2=769531&view=diff
==============================================================================
--- lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttribute.java
(original)
+++ lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/java/org/apache/lucene/analysis/tokenattributes/OffsetAttribute.java
Tue Apr 28 20:55:28 2009
@@ -62,6 +62,13 @@
     this.endOffset = offset;
   }
 
+  /** Set the starting and ending offset.
+    @see #startOffset() and #endOffset()*/
+  public void setOffset(int startOffset, int endOffset) {
+    this.startOffset = startOffset;
+    this.endOffset = endOffset;
+  }
+
   public void clear() {
     startOffset = 0;
     endOffset = 0;

Modified: lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java?rev=769531&r1=769530&r2=769531&view=diff
==============================================================================
--- lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
(original)
+++ lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
Tue Apr 28 20:55:28 2009
@@ -51,8 +51,7 @@
           return false;
         } else {
           termAtt.setTermBuffer(tokens[index++]);
-          offsetAtt.setStartOffset(0);
-          offsetAtt.setEndOffset(0);
+          offsetAtt.setOffset(0, 0);
           return true;
         }        
       }

Modified: lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=769531&r1=769530&r2=769531&view=diff
==============================================================================
--- lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/index/TestTermVectorsReader.java
(original)
+++ lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/index/TestTermVectorsReader.java
Tue Apr 28 20:55:28 2009
@@ -137,8 +137,7 @@
       else {
         final TestToken testToken = tokens[tokenUpto++];
         termAtt.setTermBuffer(testToken.text);
-        offsetAtt.setStartOffset(testToken.startOffset);
-        offsetAtt.setEndOffset(testToken.endOffset);
+        offsetAtt.setOffset(testToken.startOffset, testToken.endOffset);
         if (tokenUpto > 1) {
           posIncrAtt.setPositionIncrement(testToken.pos - tokens[tokenUpto-2].pos);
         } else {

Modified: lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java?rev=769531&r1=769530&r2=769531&view=diff
==============================================================================
--- lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java
(original)
+++ lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestMultiAnalyzer.java
Tue Apr 28 20:55:28 2009
@@ -163,8 +163,7 @@
     public final boolean incrementToken() throws java.io.IOException {
       if (multiToken > 0) {
         termAtt.setTermBuffer("multi"+(multiToken+1));
-        offsetAtt.setStartOffset(prevStartOffset);
-        offsetAtt.setEndOffset(prevEndOffset);
+        offsetAtt.setOffset(prevStartOffset, prevEndOffset);
         typeAtt.setType(prevType);
         posIncrAtt.setPositionIncrement(0);
         multiToken--;

Modified: lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=769531&r1=769530&r2=769531&view=diff
==============================================================================
--- lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestQueryParser.java
(original)
+++ lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/queryParser/TestQueryParser.java
Tue Apr 28 20:55:28 2009
@@ -85,8 +85,7 @@
       if (inPhrase) {
         inPhrase = false;
         termAtt.setTermBuffer("phrase2");
-        offsetAtt.setStartOffset(savedStart);
-        offsetAtt.setEndOffset(savedEnd);
+        offsetAtt.setOffset(savedStart, savedEnd);
         return true;
       } else
         while (input.incrementToken()) {
@@ -95,8 +94,7 @@
             savedStart = offsetAtt.startOffset();
             savedEnd = offsetAtt.endOffset();
             termAtt.setTermBuffer("phrase1");
-            offsetAtt.setStartOffset(savedStart);
-            offsetAtt.setEndOffset(savedEnd);
+            offsetAtt.setOffset(savedStart, savedEnd);
             return true;
           } else if (!termAtt.term().equals("stop"))
             return true;

Modified: lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/search/TestPositionIncrement.java
URL: http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/search/TestPositionIncrement.java?rev=769531&r1=769530&r2=769531&view=diff
==============================================================================
--- lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/search/TestPositionIncrement.java
(original)
+++ lucene/java/tags/lucene_2_4_back_compat_tests_20090415/src/test/org/apache/lucene/search/TestPositionIncrement.java
Tue Apr 28 20:55:28 2009
@@ -59,8 +59,7 @@
             if (i == TOKENS.length)
               return false;
             termAtt.setTermBuffer(TOKENS[i]);
-            offsetAtt.setStartOffset(i);
-            offsetAtt.setEndOffset(i);
+            offsetAtt.setOffset(i, i);
             posIncrAtt.setPositionIncrement(INCREMENTS[i]);
             i++;
             return true;



Mime
View raw message