lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r824527 - in /lucene/java/trunk: ./ src/java/org/apache/lucene/search/ src/java/org/apache/lucene/search/function/ src/java/org/apache/lucene/search/spans/ src/test/org/apache/lucene/search/spans/
Date Mon, 12 Oct 2009 22:40:31 GMT
Author: buschmi
Date: Mon Oct 12 22:40:30 2009
New Revision: 824527

URL: http://svn.apache.org/viewvc?rev=824527&view=rev
Log:
LUCENE-1975: Remove deprecated SpanQuery.getTerms() and generify Query.extractTerms(Set<Term>)

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/PhraseQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TermQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Mon Oct 12 22:40:30 2009
@@ -53,6 +53,9 @@
 * LUCENE-1971: Remove deprecated RangeQuery, RangeFilter and
   ConstantScoreRangeQuery. (Uwe Schindler)
 
+* LUCENE-1975: Remove deprecated SpanQuery.getTerms() and generify 
+  Query.extractTerms(Set<Term>) (Michael Busch)
+
 Bug fixes
 
 * LUCENE-1951: When the text provided to WildcardQuery has no wildcard

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanQuery.java Mon Oct 12 22:40:30
2009
@@ -18,6 +18,7 @@
  */
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.util.ToStringUtils;
 import org.apache.lucene.search.BooleanClause.Occur;
 
@@ -449,7 +450,7 @@
   }
 
   // inherit javadoc
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
       for (Iterator i = clauses.iterator(); i.hasNext();) {
           BooleanClause clause = (BooleanClause) i.next();
           clause.getQuery().extractTerms(terms);

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/ConstantScoreQuery.java Mon Oct 12
22:40:30 2009
@@ -18,6 +18,7 @@
  */
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 
 import java.io.IOException;
 import java.util.Set;
@@ -42,7 +43,7 @@
     return this;
   }
 
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     // OK to not add any terms when used for MultiSearcher,
     // but may not be OK for highlighting
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java Mon Oct 12
22:40:30 2009
@@ -23,6 +23,7 @@
 import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 
 /**
  * A query that generates the union of documents produced by its subqueries, and that scores
each document with the maximum
@@ -213,7 +214,7 @@
   }
 
   // inherit javadoc
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     for (Iterator iter = disjuncts.iterator(); iter.hasNext();) {
       ((Query) iter.next()).extractTerms(terms);
     }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FilteredQuery.java Mon Oct 12 22:40:30
2009
@@ -18,6 +18,7 @@
  */
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.util.ToStringUtils;
 
 import java.io.IOException;
@@ -187,7 +188,7 @@
   }
 
   // inherit javadoc
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
       getQuery().extractTerms(terms);
   }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/MatchAllDocsQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/MatchAllDocsQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/MatchAllDocsQuery.java Mon Oct 12
22:40:30 2009
@@ -18,6 +18,7 @@
  */
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.util.ToStringUtils;
 
@@ -131,7 +132,7 @@
     return new MatchAllDocsWeight(searcher);
   }
 
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
   }
 
   public String toString(String field) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java Mon Oct 12 22:40:30
2009
@@ -113,7 +113,7 @@
   }
 
   // inherit javadoc
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     for (Iterator iter = termArrays.iterator(); iter.hasNext();) {
       Term[] arr = (Term[])iter.next();
       for (int i=0; i<arr.length; i++) {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/PhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/PhraseQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/PhraseQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/PhraseQuery.java Mon Oct 12 22:40:30
2009
@@ -251,9 +251,9 @@
   }
 
   /**
-   * @see org.apache.lucene.search.Query#extractTerms(java.util.Set)
+   * @see org.apache.lucene.search.Query#extractTerms(Set)
    */
-  public void extractTerms(Set queryTerms) {
+  public void extractTerms(Set<Term> queryTerms) {
     queryTerms.addAll(terms);
   }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/Query.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/Query.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/Query.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/Query.java Mon Oct 12 22:40:30 2009
@@ -24,6 +24,7 @@
 import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 
 /** The abstract base class for queries.
     <p>Instantiable subclasses are:
@@ -165,7 +166,7 @@
    * 
    * @throws UnsupportedOperationException if this query is not yet rewritten
    */
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     // needs to be implemented by query subclasses
     throw new UnsupportedOperationException();
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/TermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TermQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/TermQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TermQuery.java Mon Oct 12 22:40:30
2009
@@ -146,7 +146,7 @@
     return new TermWeight(searcher);
   }
 
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     terms.add(getTerm());
   }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/function/CustomScoreQuery.java Mon
Oct 12 22:40:30 2009
@@ -21,6 +21,7 @@
 import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.ComplexExplanation;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.Query;
@@ -98,7 +99,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.Query#extractTerms(java.util.Set) */
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     subQuery.extractTerms(terms);
     for(int i = 0; i < valSrcQueries.length; i++) {
       valSrcQueries[i].extractTerms(terms);

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/function/ValueSourceQuery.java Mon
Oct 12 22:40:30 2009
@@ -18,6 +18,7 @@
  */
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.search.*;
 import org.apache.lucene.util.ToStringUtils;
@@ -58,7 +59,7 @@
   }
 
   /*(non-Javadoc) @see org.apache.lucene.search.Query#extractTerms(java.util.Set) */
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     // no terms involved here
   }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java Mon
Oct 12 22:40:30 2009
@@ -22,6 +22,7 @@
 import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.Weight;
 import org.apache.lucene.search.Searcher;
@@ -94,12 +95,7 @@
     return maskedQuery.getSpans(reader);
   }
 
-  /** @deprecated use {@link #extractTerms(Set)} instead. */
-  public Collection getTerms() {
-    return maskedQuery.getTerms();
-  }
-  
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     maskedQuery.extractTerms(terms);
   }  
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java Mon Oct
12 22:40:30 2009
@@ -24,6 +24,7 @@
 import java.util.ArrayList;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.util.ToStringUtils;
 
@@ -47,12 +48,6 @@
 
   public String getField() { return match.getField(); }
 
-  /** Returns a collection of all terms matched by this query.
-   * @deprecated use extractTerms instead
-   * @see #extractTerms(Set)
-   */
-  public Collection getTerms() { return match.getTerms(); }
-
   public String toString(String field) {
     StringBuilder buffer = new StringBuilder();
     buffer.append("spanFirst(");
@@ -70,7 +65,7 @@
     return spanFirstQuery;
   }
   
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
 	    match.extractTerms(terms);
   }
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java Mon Oct 12
22:40:30 2009
@@ -27,6 +27,7 @@
 
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.util.ToStringUtils;
 
@@ -80,21 +81,7 @@
 
   public String getField() { return field; }
   
-  /** Returns a collection of all terms matched by this query.
-   * @deprecated use extractTerms instead
-   * @see #extractTerms(Set)
-   */
-  public Collection getTerms() {
-    Collection terms = new ArrayList();
-    Iterator i = clauses.iterator();
-    while (i.hasNext()) {
-      SpanQuery clause = (SpanQuery)i.next();
-      terms.addAll(clause.getTerms());
-    }
-    return terms;
-  }
-  
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
 	    Iterator i = clauses.iterator();
 	    while (i.hasNext()) {
 	      SpanQuery clause = (SpanQuery)i.next();

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java Mon Oct 12
22:40:30 2009
@@ -18,6 +18,7 @@
  */
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.util.ToStringUtils;
 
@@ -49,13 +50,7 @@
 
   public String getField() { return include.getField(); }
 
-  /** Returns a collection of all terms matched by this query.
-   * @deprecated use extractTerms instead
-   * @see #extractTerms(Set)
-   */
-  public Collection getTerms() { return include.getTerms(); }
-  
-  public void extractTerms(Set terms) { include.extractTerms(terms); }
+  public void extractTerms(Set<Term> terms) { include.extractTerms(terms); }
 
   public String toString(String field) {
     StringBuilder buffer = new StringBuilder();

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java Mon Oct 12
22:40:30 2009
@@ -26,6 +26,7 @@
 import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
 import org.apache.lucene.util.PriorityQueue;
 import org.apache.lucene.util.ToStringUtils;
 import org.apache.lucene.search.Query;
@@ -58,21 +59,7 @@
 
   public String getField() { return field; }
 
-  /** Returns a collection of all terms matched by this query.
-   * @deprecated use extractTerms instead
-   * @see #extractTerms(Set)
-   */
-  public Collection getTerms() {
-    Collection terms = new ArrayList();
-    Iterator i = clauses.iterator();
-    while (i.hasNext()) {
-      SpanQuery clause = (SpanQuery)i.next();
-      terms.addAll(clause.getTerms());
-    }
-    return terms;
-  }
-  
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
     Iterator i = clauses.iterator();
     while (i.hasNext()) {
       SpanQuery clause = (SpanQuery)i.next();

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanQuery.java Mon Oct 12 22:40:30
2009
@@ -19,6 +19,7 @@
 
 import java.io.IOException;
 import java.util.Collection;
+import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.Query;
@@ -34,12 +35,6 @@
   /** Returns the name of the field matched by this query.*/
   public abstract String getField();
 
-  /** Returns a collection of all terms matched by this query.
-   * @deprecated use extractTerms instead
-   * @see Query#extractTerms(Set)
-   */
-  public abstract Collection getTerms();
-  
   public Weight createWeight(Searcher searcher) throws IOException {
     return new SpanWeight(this, searcher);
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery.java Mon Oct 12
22:40:30 2009
@@ -38,16 +38,7 @@
 
   public String getField() { return term.field(); }
   
-  /** Returns a collection of all terms matched by this query.
-   * @deprecated use extractTerms instead
-   * @see #extractTerms(Set)
-   */
-  public Collection getTerms() {
-    Collection terms = new ArrayList();
-    terms.add(term);
-    return terms;
-  }
-  public void extractTerms(Set terms) {
+  public void extractTerms(Set<Term> terms) {
 	  terms.add(term);
   }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
(original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
Mon Oct 12 22:40:30 2009
@@ -77,11 +77,6 @@
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 
-    /** @deprecated delete in 3.0. */
-    public Collection getTerms() {
-      throw new UnsupportedOperationException(UNSUPPORTED_MSG);
-    }
-
     public String toString(String field) {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java?rev=824527&r1=824526&r2=824527&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
(original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
Mon Oct 12 22:40:30 2009
@@ -17,28 +17,22 @@
  * limitations under the License.
  */
 
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.Scorer;
-import org.apache.lucene.search.Weight;
-import org.apache.lucene.search.CheckHits;
-import org.apache.lucene.search.QueryUtils;
-
-import org.apache.lucene.store.RAMDirectory;
-
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.Term;
+import java.util.HashSet;
+import java.util.Set;
 
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
-
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
-
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.CheckHits;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.QueryUtils;
+import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.LuceneTestCase;
 
-import java.util.HashSet;
-
 public class TestFieldMaskingSpanQuery extends LuceneTestCase {
 
   protected static Document doc(Field[] fields) {
@@ -137,7 +131,9 @@
 
     QueryUtils.checkEqual(q, qr);
 
-    assertEquals(1, qr.getTerms().size());
+    Set<Term> terms = new HashSet<Term>();
+    qr.extractTerms(terms);
+    assertEquals(1, terms.size());
   }
   
   public void testRewrite1() throws Exception {
@@ -155,7 +151,9 @@
 
     QueryUtils.checkUnequal(q, qr);
 
-    assertEquals(2, qr.getTerms().size());
+    Set<Term> terms = new HashSet<Term>();
+    qr.extractTerms(terms);
+    assertEquals(2, terms.size());
   }
   
   public void testRewrite2() throws Exception {



Mime
View raw message