lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r758575 - in /lucene/java/trunk/contrib/benchmark/src: java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java
Date Thu, 26 Mar 2009 10:03:42 GMT
Author: mikemccand
Date: Thu Mar 26 10:03:34 2009
New Revision: 758575

URL: http://svn.apache.org/viewvc?rev=758575&view=rev
Log:
LUCENE-1500: fix compilation errors in contrib/benchmark by allowing doHighlight method to
throw InvalidTokenOfsetsException

Modified:
    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
    lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java

Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java?rev=758575&r1=758574&r2=758575&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/ReadTask.java
Thu Mar 26 10:03:34 2009
@@ -41,6 +41,7 @@
 import org.apache.lucene.search.highlight.SimpleHTMLFormatter;
 import org.apache.lucene.search.highlight.TextFragment;
 import org.apache.lucene.search.highlight.TokenSources;
+import org.apache.lucene.search.highlight.InvalidTokenOffsetsException;
 import org.apache.lucene.store.Directory;
 
 
@@ -238,7 +239,7 @@
     return false;
   }
 
-  protected int doHighlight(TokenStream ts, String text,  Highlighter highlighter, boolean
mergeContiguous, int maxFragments) throws IOException {
+  protected int doHighlight(TokenStream ts, String text,  Highlighter highlighter, boolean
mergeContiguous, int maxFragments) throws IOException, InvalidTokenOffsetsException {
     TextFragment[] frag = highlighter.getBestTextFragments(ts, text, mergeContiguous, maxFragments);
     return frag != null ? frag.length : 0;
   }

Modified: lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java?rev=758575&r1=758574&r2=758575&view=diff
==============================================================================
--- lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java
(original)
+++ lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/tasks/CountingHighlighterTestTask.java
Thu Mar 26 10:03:34 2009
@@ -21,6 +21,7 @@
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.search.highlight.Highlighter;
 import org.apache.lucene.search.highlight.TextFragment;
+import org.apache.lucene.search.highlight.InvalidTokenOffsetsException;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexReader;
 
@@ -46,11 +47,9 @@
     return document;
   }
 
-  protected int doHighlight(TokenStream ts, String text,  Highlighter highlighter, boolean
mergeContiguous, int maxFragments) throws IOException {
+  protected int doHighlight(TokenStream ts, String text,  Highlighter highlighter, boolean
mergeContiguous, int maxFragments) throws IOException, InvalidTokenOffsetsException {
     TextFragment[] frag = highlighter.getBestTextFragments(ts, text, mergeContiguous, maxFragments);
     numHighlightedResults += frag != null ? frag.length : 0;
     return frag != null ? frag.length : 0;
   }
-
-
 }
\ No newline at end of file



Mime
View raw message