Skip to content

Apache Lucene open-source search software

LUCENE-1970: Remove deprecated DocIdSetIterator methods.

Michael Busch35f0f926a2ab
diff --git a/CHANGES.txt b/CHANGES.txt
index de63ab6c505..03d8397dcf8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -41,6 +41,9 @@ API Changes
* LUCENE-1968: Remove deprecated methods in PriorityQueue. (Michael Busch)
+* LUCENE-1970: Remove deprecated methods in DocIdSetIterator and make
+ new ones abstract. (Michael Busch)
+
Bug fixes
* LUCENE-1951: When the text provided to WildcardQuery has no wildcard
diff --git a/src/java/org/apache/lucene/search/BooleanScorer.java b/src/java/org/apache/lucene/search/BooleanScorer.java
index 86874468301..9b52279ed54 100644
--- a/src/java/org/apache/lucene/search/BooleanScorer.java
+++ b/src/java/org/apache/lucene/search/BooleanScorer.java
@@ -116,23 +116,14 @@ final class BooleanScorer extends Scorer {
public int advance(int target) throws IOException { return NO_MORE_DOCS; }
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return doc; }
-
public int docID() { return doc; }
public Explanation explain(int doc) throws IOException { return null; }
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException { return false; }
-
public int nextDoc() throws IOException { return NO_MORE_DOCS; }
public float score() throws IOException { return score; }
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException { return false; }
-
}
static final class Bucket {
@@ -289,9 +280,6 @@ final class BooleanScorer extends Scorer {
throw new UnsupportedOperationException();
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return current.doc; }
-
public int docID() {
return doc;
}
@@ -300,11 +288,6 @@ final class BooleanScorer extends Scorer {
throw new UnsupportedOperationException();
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
boolean more;
do {
@@ -351,11 +334,6 @@ final class BooleanScorer extends Scorer {
score(new HitCollectorWrapper(hc));
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) {
- throw new UnsupportedOperationException();
- }
-
public String toString() {
StringBuilder buffer = new StringBuilder();
buffer.append("boolean(");
diff --git a/src/java/org/apache/lucene/search/BooleanScorer2.java b/src/java/org/apache/lucene/search/BooleanScorer2.java
index a83bdf308fc..3e2eb7d8231 100644
--- a/src/java/org/apache/lucene/search/BooleanScorer2.java
+++ b/src/java/org/apache/lucene/search/BooleanScorer2.java
@@ -124,24 +124,12 @@ class BooleanScorer2 extends Scorer {
}
return lastDocScore;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return scorer.doc();
- }
public int docID() {
return scorer.docID();
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return scorer.nextDoc() != NO_MORE_DOCS;
- }
public int nextDoc() throws IOException {
return scorer.nextDoc();
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int docNr) throws IOException {
- return scorer.advance(docNr) != NO_MORE_DOCS;
- }
public int advance(int target) throws IOException {
return scorer.advance(target);
}
@@ -316,18 +304,10 @@ class BooleanScorer2 extends Scorer {
return doc != NO_MORE_DOCS;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return countingSumScorer.doc(); }
-
public int docID() {
return doc;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
return doc = countingSumScorer.nextDoc();
}
@@ -338,11 +318,6 @@ class BooleanScorer2 extends Scorer {
return sum * coordinator.coordFactors[coordinator.nrMatchers];
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
return doc = countingSumScorer.advance(target);
}
diff --git a/src/java/org/apache/lucene/search/ConjunctionScorer.java b/src/java/org/apache/lucene/search/ConjunctionScorer.java
index 57f3cd85d7a..12824e9b210 100644
--- a/src/java/org/apache/lucene/search/ConjunctionScorer.java
+++ b/src/java/org/apache/lucene/search/ConjunctionScorer.java
@@ -109,9 +109,6 @@ class ConjunctionScorer extends Scorer {
return lastDoc = doNext();
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return lastDoc; }
-
public int docID() {
return lastDoc;
}
@@ -120,11 +117,6 @@ class ConjunctionScorer extends Scorer {
throw new UnsupportedOperationException();
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
if (lastDoc == NO_MORE_DOCS) {
return lastDoc;
@@ -142,10 +134,4 @@ class ConjunctionScorer extends Scorer {
}
return sum * coord;
}
-
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
}
diff --git a/src/java/org/apache/lucene/search/ConstantScoreQuery.java b/src/java/org/apache/lucene/search/ConstantScoreQuery.java
index 946fc165c75..98507b8e8da 100644
--- a/src/java/org/apache/lucene/search/ConstantScoreQuery.java
+++ b/src/java/org/apache/lucene/search/ConstantScoreQuery.java
@@ -123,20 +123,10 @@ public class ConstantScoreQuery extends Query {
}
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return docIdSetIterator.nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
return docIdSetIterator.nextDoc();
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return docIdSetIterator.doc();
- }
-
public int docID() {
return docIdSetIterator.docID();
}
@@ -145,11 +135,6 @@ public class ConstantScoreQuery extends Query {
return theScore;
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return docIdSetIterator.advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
return docIdSetIterator.advance(target);
}
diff --git a/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java b/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java
index 7c6aa9bdac5..7d3d5563c93 100644
--- a/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java
+++ b/src/java/org/apache/lucene/search/DisjunctionMaxScorer.java
@@ -62,16 +62,6 @@ class DisjunctionMaxScorer extends Scorer {
heapify();
}
- /**
- * Generate the next document matching our associated DisjunctionMaxQuery.
- *
- * @return true iff there is a next document
- * @deprecated use {@link #nextDoc()} instead.
- */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
if (numScorers == 0) return doc = NO_MORE_DOCS;
while (subScorers[0].docID() == doc) {
@@ -88,11 +78,6 @@ class DisjunctionMaxScorer extends Scorer {
return doc = subScorers[0].docID();
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return subScorers[0].doc();
- }
-
public int docID() {
return doc;
}
@@ -120,20 +105,6 @@ class DisjunctionMaxScorer extends Scorer {
}
}
- /**
- * Advance to the first document beyond the current whose number is greater
- * than or equal to target.
- *
- * @param target
- * the minimum number of the next desired document
- * @return true iff there is a document to be generated whose number is at
- * least target
- * @deprecated use {@link #advance(int)} instead.
- */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
if (numScorers == 0) return doc = NO_MORE_DOCS;
while (subScorers[0].docID() < target) {
diff --git a/src/java/org/apache/lucene/search/DisjunctionSumScorer.java b/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
index 3b0b891a0b8..24152f60e74 100644
--- a/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
+++ b/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
@@ -161,11 +161,6 @@ class DisjunctionSumScorer extends Scorer {
return true;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
if (scorerDocQueue.size() < minimumNrMatchers || !advanceAfterCurrent()) {
currentDoc = NO_MORE_DOCS;
@@ -222,9 +217,6 @@ class DisjunctionSumScorer extends Scorer {
*/
public float score() throws IOException { return currentScore; }
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return currentDoc; }
-
public int docID() {
return currentDoc;
}
@@ -236,22 +228,6 @@ class DisjunctionSumScorer extends Scorer {
return nrMatchers;
}
- /**
- * Skips to the first match beyond the current whose document number is
- * greater than or equal to a given target. <br>
- * When this method is used the {@link #explain(int)} method should not be
- * used. <br>
- * The implementation uses the skipTo() method on the subscorers.
- *
- * @param target
- * The target document number.
- * @return true iff there is such a match.
- * @deprecated use {@link #advance(int)} instead.
- */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
/**
* Advances to the first match beyond the current whose document number is
* greater than or equal to a given target. <br>
diff --git a/src/java/org/apache/lucene/search/DocIdSetIterator.java b/src/java/org/apache/lucene/search/DocIdSetIterator.java
index 530f2dcd76b..0ab8dbe814c 100644
--- a/src/java/org/apache/lucene/search/DocIdSetIterator.java
+++ b/src/java/org/apache/lucene/search/DocIdSetIterator.java
@@ -28,7 +28,6 @@ import java.io.IOException;
*/
public abstract class DocIdSetIterator {
- // TODO (3.0): review the javadocs and remove any references to '3.0'.
private int doc = -1;
/**
@@ -37,16 +36,6 @@ public abstract class DocIdSetIterator {
*/
public static final int NO_MORE_DOCS = Integer.MAX_VALUE;
- /**
- * Unsupported anymore. Call {@link #docID()} instead. This method throws
- * {@link UnsupportedOperationException} if called.
- *
- * @deprecated use {@link #docID()} instead.
- */
- public int doc() {
- throw new UnsupportedOperationException("Call docID() instead.");
- }
-
/**
* Returns the following:
* <ul>
@@ -56,56 +45,22 @@ public abstract class DocIdSetIterator {
* <li>Otherwise it should return the doc ID it is currently on.
* </ul>
* <p>
- * <b>NOTE:</b> in 3.0, this method will become abstract.
*
* @since 2.9
*/
- public int docID() {
- return doc;
- }
-
- /**
- * Unsupported anymore. Call {@link #nextDoc()} instead. This method throws
- * {@link UnsupportedOperationException} if called.
- *
- * @deprecated use {@link #nextDoc()} instead. This will be removed in 3.0
- */
- public boolean next() throws IOException {
- throw new UnsupportedOperationException("Call nextDoc() instead.");
- }
-
- /**
- * Unsupported anymore. Call {@link #advance(int)} instead. This method throws
- * {@link UnsupportedOperationException} if called.
- *
- * @deprecated use {@link #advance(int)} instead. This will be removed in 3.0
- */
- public boolean skipTo(int target) throws IOException {
- throw new UnsupportedOperationException("Call advance() instead.");
- }
+ public abstract int docID();
/**
* Advances to the next document in the set and returns the doc it is
* currently on, or {@link #NO_MORE_DOCS} if there are no more docs in the
* set.<br>
*
- * <b>NOTE:</b> in 3.0 this method will become abstract, following the removal
- * of {@link #next()}. For backward compatibility it is implemented as:
- *
- * <pre>
- * public int nextDoc() throws IOException {
- * return next() ? doc() : NO_MORE_DOCS;
- * }
- * </pre>
- *
* <b>NOTE:</b> after the iterator has exhausted you should not call this
* method, as it may result in unpredicted behavior.
*
* @since 2.9
*/
- public int nextDoc() throws IOException {
- return doc = next() ? doc() : NO_MORE_DOCS;
- }
+ public abstract int nextDoc() throws IOException;
/**
* Advances to the first beyond the current whose document number is greater
@@ -136,16 +91,9 @@ public abstract class DocIdSetIterator {
* <b>NOTE:</b> after the iterator has exhausted you should not call this
* method, as it may result in unpredicted behavior.
* <p>
- * <b>NOTE:</b> in 3.0 this method will become abstract, following the removal
- * of {@link #skipTo(int)}.
*
* @since 2.9
*/
- public int advance(int target) throws IOException {
- if (target == NO_MORE_DOCS) {
- return doc = NO_MORE_DOCS;
- }
- return doc = skipTo(target) ? doc() : NO_MORE_DOCS;
- }
+ public abstract int advance(int target) throws IOException;
}
diff --git a/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java b/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
index 6847960b1ea..8b1985fd102 100644
--- a/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
+++ b/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java
@@ -496,21 +496,6 @@ public abstract class FieldCacheRangeFilter extends Filter {
return new DocIdSetIterator() {
private int doc = -1;
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return termDocs.doc();
- }
-
public int docID() {
return doc;
}
@@ -539,21 +524,6 @@ public abstract class FieldCacheRangeFilter extends Filter {
return new DocIdSetIterator() {
private int doc = -1;
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return doc;
- }
-
public int docID() {
return doc;
}
diff --git a/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java b/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
index 0e0faef93f3..b536383c5e6 100644
--- a/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
+++ b/src/java/org/apache/lucene/search/FieldCacheTermsFilter.java
@@ -138,20 +138,10 @@ public class FieldCacheTermsFilter extends Filter {
protected class FieldCacheTermsFilterDocIdSetIterator extends DocIdSetIterator {
private int doc = -1;
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return doc;
- }
-
public int docID() {
return doc;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() {
try {
while (!openBitSet.fastGet(fcsi.order[++doc])) {}
@@ -161,11 +151,6 @@ public class FieldCacheTermsFilter extends Filter {
return doc;
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) {
try {
doc = target;
diff --git a/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java b/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java
index 8db909788e3..a3eba6ff234 100644
--- a/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java
+++ b/src/java/org/apache/lucene/search/FilteredDocIdSetIterator.java
@@ -49,20 +49,10 @@ public abstract class FilteredDocIdSetIterator extends DocIdSetIterator {
*/
abstract protected boolean match(int doc) throws IOException;
- /** @deprecated use {@link #docID()} instead. */
- public final int doc() {
- return doc;
- }
-
public int docID() {
return doc;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public final boolean next() throws IOException{
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
while ((doc = _innerIter.nextDoc()) != NO_MORE_DOCS) {
if (match(doc)) {
@@ -72,11 +62,6 @@ public abstract class FilteredDocIdSetIterator extends DocIdSetIterator {
return doc;
}
- /** @deprecated use {@link #advance(int)} instead. */
- public final boolean skipTo(int n) throws IOException{
- return advance(n) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
doc = _innerIter.advance(target);
if (doc != NO_MORE_DOCS) {
diff --git a/src/java/org/apache/lucene/search/FilteredQuery.java b/src/java/org/apache/lucene/search/FilteredQuery.java
index f8edd3fb915..b8bd16b55c4 100644
--- a/src/java/org/apache/lucene/search/FilteredQuery.java
+++ b/src/java/org/apache/lucene/search/FilteredQuery.java
@@ -130,11 +130,6 @@ extends Query {
return scorerDoc;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
int scorerDoc, disiDoc;
return doc = (disiDoc = docIdSetIterator.nextDoc()) != NO_MORE_DOCS
@@ -142,15 +137,8 @@ extends Query {
&& advanceToCommon(scorerDoc, disiDoc) != NO_MORE_DOCS ? scorer.docID() : NO_MORE_DOCS;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return scorer.doc(); }
public int docID() { return doc; }
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int i) throws IOException {
- return advance(i) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
int disiDoc, scorerDoc;
return doc = (disiDoc = docIdSetIterator.advance(target)) != NO_MORE_DOCS
diff --git a/src/java/org/apache/lucene/search/MatchAllDocsQuery.java b/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
index 874642dd290..cb2bfcf68eb 100644
--- a/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
+++ b/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
@@ -61,20 +61,10 @@ public class MatchAllDocsQuery extends Query {
return null; // not called... see MatchAllDocsWeight.explain()
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return termDocs.doc();
- }
-
public int docID() {
return doc;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
return doc = termDocs.next() ? termDocs.doc() : NO_MORE_DOCS;
}
@@ -83,11 +73,6 @@ public class MatchAllDocsQuery extends Query {
return norms == null ? score : score * Similarity.decodeNorm(norms[docID()]);
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
return doc = termDocs.skipTo(target) ? termDocs.doc() : NO_MORE_DOCS;
}
diff --git a/src/java/org/apache/lucene/search/PhraseScorer.java b/src/java/org/apache/lucene/search/PhraseScorer.java
index 1271086f4e7..021ac55bade 100644
--- a/src/java/org/apache/lucene/search/PhraseScorer.java
+++ b/src/java/org/apache/lucene/search/PhraseScorer.java
@@ -69,16 +69,8 @@ abstract class PhraseScorer extends Scorer {
first.doc = -1;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return first.doc; }
-
public int docID() { return first.doc; }
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
if (firstTime) {
init();
@@ -118,11 +110,6 @@ abstract class PhraseScorer extends Scorer {
return norms == null ? raw : raw * Similarity.decodeNorm(norms[first.doc]); // normalize
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
firstTime = false;
for (PhrasePositions pp = first; more && pp != null; pp = pp.next) {
diff --git a/src/java/org/apache/lucene/search/ReqExclScorer.java b/src/java/org/apache/lucene/search/ReqExclScorer.java
index 6fa6e597585..d3307bf7314 100644
--- a/src/java/org/apache/lucene/search/ReqExclScorer.java
+++ b/src/java/org/apache/lucene/search/ReqExclScorer.java
@@ -41,11 +41,6 @@ class ReqExclScorer extends Scorer {
this.exclDisi = exclDisi;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
if (reqScorer == null) {
return doc;
@@ -93,11 +88,6 @@ class ReqExclScorer extends Scorer {
return NO_MORE_DOCS;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return reqScorer.doc(); // reqScorer may be null when next() or skipTo() already return false
- }
-
public int docID() {
return doc;
}
@@ -110,11 +100,6 @@ class ReqExclScorer extends Scorer {
return reqScorer.score(); // reqScorer may be null when next() or skipTo() already return false
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
if (reqScorer == null) {
return doc = NO_MORE_DOCS;
diff --git a/src/java/org/apache/lucene/search/ReqOptSumScorer.java b/src/java/org/apache/lucene/search/ReqOptSumScorer.java
index 1260c5e3ca4..bf0eca3f7e5 100644
--- a/src/java/org/apache/lucene/search/ReqOptSumScorer.java
+++ b/src/java/org/apache/lucene/search/ReqOptSumScorer.java
@@ -43,29 +43,14 @@ class ReqOptSumScorer extends Scorer {
this.optScorer = optScorer;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return reqScorer.next();
- }
-
public int nextDoc() throws IOException {
return reqScorer.nextDoc();
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return reqScorer.skipTo(target);
- }
-
public int advance(int target) throws IOException {
return reqScorer.advance(target);
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return reqScorer.doc();
- }
-
public int docID() {
return reqScorer.docID();
}
diff --git a/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java b/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java
index 265f7cd808e..5b8c4b1dadf 100644
--- a/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java
+++ b/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java
@@ -64,20 +64,10 @@ public class ScoreCachingWrappingScorer extends Scorer {
return curScore;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return scorer.doc();
- }
-
public int docID() {
return scorer.docID();
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return scorer.next();
- }
-
public int nextDoc() throws IOException {
return scorer.nextDoc();
}
@@ -86,11 +76,6 @@ public class ScoreCachingWrappingScorer extends Scorer {
scorer.score(collector);
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return scorer.skipTo(target);
- }
-
public int advance(int target) throws IOException {
return scorer.advance(target);
}
diff --git a/src/java/org/apache/lucene/search/TermScorer.java b/src/java/org/apache/lucene/search/TermScorer.java
index fa26f3b90c8..9a8abab3dfd 100644
--- a/src/java/org/apache/lucene/search/TermScorer.java
+++ b/src/java/org/apache/lucene/search/TermScorer.java
@@ -100,23 +100,8 @@ final class TermScorer extends Scorer {
return true;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return doc; }
-
public int docID() { return doc; }
- /**
- * Advances to the next document matching the query. <br>
- * The iterator over the matching documents is buffered using
- * {@link TermDocs#read(int[],int[])}.
- *
- * @return true iff there is another document matching the query.
- * @deprecated use {@link #nextDoc()} instead.
- */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
/**
* Advances to the next document matching the query. <br>
* The iterator over the matching documents is buffered using
@@ -150,20 +135,6 @@ final class TermScorer extends Scorer {
return norms == null ? raw : raw * SIM_NORM_DECODER[norms[doc] & 0xFF]; // normalize for field
}
- /**
- * Skips to the first match beyond the current whose document number is
- * greater than or equal to a given target. <br>
- * The implementation uses {@link TermDocs#skipTo(int)}.
- *
- * @param target
- * The target document number.
- * @return true iff there is such a match.
- * @deprecated use {@link #advance(int)} instead.
- */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
/**
* Advances to the first match beyond the current whose document number is
* greater than or equal to a given target. <br>
diff --git a/src/java/org/apache/lucene/search/function/CustomScoreQuery.java b/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
index 10db0c8d814..b4d0d50357c 100755
--- a/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
+++ b/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
@@ -401,11 +401,6 @@ public class CustomScoreQuery extends Query {
this.vScores = new float[valSrcScorers.length];
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
int doc = subQueryScorer.nextDoc();
if (doc != NO_MORE_DOCS) {
@@ -416,11 +411,6 @@ public class CustomScoreQuery extends Query {
return doc;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return subQueryScorer.doc();
- }
-
public int docID() {
return subQueryScorer.docID();
}
@@ -433,11 +423,6 @@ public class CustomScoreQuery extends Query {
return qWeight * customScore(subQueryScorer.docID(), subQueryScorer.score(), vScores);
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
int doc = subQueryScorer.advance(target);
if (doc != NO_MORE_DOCS) {
diff --git a/src/java/org/apache/lucene/search/function/ValueSourceQuery.java b/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
index 228885ff002..7da3e248a87 100644
--- a/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
+++ b/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
@@ -126,38 +126,23 @@ public class ValueSourceQuery extends Query {
termDocs = reader.termDocs(null);
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return termDocs.next();
- }
-
public int nextDoc() throws IOException {
return doc = termDocs.next() ? termDocs.doc() : NO_MORE_DOCS;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return termDocs.doc();
- }
-
public int docID() {
return doc;
}
+ public int advance(int target) throws IOException {
+ return doc = termDocs.skipTo(target) ? termDocs.doc() : NO_MORE_DOCS;
+ }
+
/*(non-Javadoc) @see org.apache.lucene.search.Scorer#score() */
public float score() throws IOException {
return qWeight * vals.floatVal(termDocs.doc());
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return termDocs.skipTo(target);
- }
-
- public int advance(int target) throws IOException {
- return doc = termDocs.skipTo(target) ? termDocs.doc() : NO_MORE_DOCS;
- }
-
/*(non-Javadoc) @see org.apache.lucene.search.Scorer#explain(int) */
public Explanation explain(int doc) throws IOException {
float sc = qWeight * vals.floatVal(doc);
diff --git a/src/java/org/apache/lucene/search/spans/SpanScorer.java b/src/java/org/apache/lucene/search/spans/SpanScorer.java
index 5d5228858e5..2e4f15eb024 100644
--- a/src/java/org/apache/lucene/search/spans/SpanScorer.java
+++ b/src/java/org/apache/lucene/search/spans/SpanScorer.java
@@ -55,11 +55,6 @@ public class SpanScorer extends Scorer {
}
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
if (!setFreqCurrentDoc()) {
doc = NO_MORE_DOCS;
@@ -67,11 +62,6 @@ public class SpanScorer extends Scorer {
return doc;
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
if (!more) {
return doc = NO_MORE_DOCS;
@@ -99,9 +89,6 @@ public class SpanScorer extends Scorer {
return true;
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return doc; }
-
public int docID() { return doc; }
public float score() throws IOException {
diff --git a/src/test/org/apache/lucene/search/JustCompileSearch.java b/src/test/org/apache/lucene/search/JustCompileSearch.java
index ad6da2265d1..d76d41bf7b1 100644
--- a/src/test/org/apache/lucene/search/JustCompileSearch.java
+++ b/src/test/org/apache/lucene/search/JustCompileSearch.java
@@ -159,25 +159,10 @@ final class JustCompileSearch {
static final class JustCompileDocIdSetIterator extends DocIdSetIterator {
- /** @deprecated delete in 3.0 */
- public int doc() {
- throw new UnsupportedOperationException(UNSUPPORTED_MSG);
- }
-
public int docID() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
- /** @deprecated delete in 3.0 */
- public boolean next() throws IOException {
- throw new UnsupportedOperationException(UNSUPPORTED_MSG);
- }
-
- /** @deprecated delete in 3.0 */
- public boolean skipTo(int target) throws IOException {
- throw new UnsupportedOperationException(UNSUPPORTED_MSG);
- }
-
public int nextDoc() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
@@ -339,25 +324,10 @@ final class JustCompileSearch {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
- /** @deprecated delete in 3.0 */
- public int doc() {
- throw new UnsupportedOperationException(UNSUPPORTED_MSG);
- }
-
public int docID() {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
- /** @deprecated delete in 3.0. */
- public boolean next() throws IOException {
- throw new UnsupportedOperationException(UNSUPPORTED_MSG);
- }
-
- /** @deprecated delete in 3.0. */
- public boolean skipTo(int target) throws IOException {
- throw new UnsupportedOperationException(UNSUPPORTED_MSG);
- }
-
public int nextDoc() throws IOException {
throw new UnsupportedOperationException(UNSUPPORTED_MSG);
}
diff --git a/src/test/org/apache/lucene/search/TestBooleanScorer.java b/src/test/org/apache/lucene/search/TestBooleanScorer.java
index a0d4d8ea4fd..556e552dc70 100644
--- a/src/test/org/apache/lucene/search/TestBooleanScorer.java
+++ b/src/test/org/apache/lucene/search/TestBooleanScorer.java
@@ -82,21 +82,12 @@ public class TestBooleanScorer extends LuceneTestCase
private int doc = -1;
public Explanation explain(int doc) throws IOException { return null; }
public float score() throws IOException { return 0; }
- /** @deprecated delete in 3.0. */
- public int doc() { return 3000; }
public int docID() { return doc; }
- /** @deprecated delete in 3.0 */
- public boolean next() throws IOException { return nextDoc() != NO_MORE_DOCS; }
public int nextDoc() throws IOException {
return doc = doc == -1 ? 3000 : NO_MORE_DOCS;
}
- /** @deprecated delete in 3.0 */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
return doc = target <= 3000 ? 3000 : NO_MORE_DOCS;
}
diff --git a/src/test/org/apache/lucene/search/TestDocIdSet.java b/src/test/org/apache/lucene/search/TestDocIdSet.java
index 75ec00d5fea..abd6261cc43 100644
--- a/src/test/org/apache/lucene/search/TestDocIdSet.java
+++ b/src/test/org/apache/lucene/search/TestDocIdSet.java
@@ -48,31 +48,16 @@ public class TestDocIdSet extends LuceneTestCase {
int docid = -1;
- /** @deprecated use {@link #docID()} instead. */
- public int doc() {
- return docid;
- }
-
public int docID() {
return docid;
}
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
//@Override
public int nextDoc() throws IOException {
docid++;
return docid < maxdoc ? docid : (docid = NO_MORE_DOCS);
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
//@Override
public int advance(int target) throws IOException {
while (nextDoc() < target) {}
diff --git a/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java b/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
index f70c22ae79f..0d7df11726b 100644
--- a/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
+++ b/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
@@ -36,25 +36,12 @@ public class TestPositiveScoresOnlyCollector extends LuceneTestCase {
return idx == scores.length ? Float.NaN : scores[idx];
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return idx; }
-
public int docID() { return idx; }
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
return ++idx != scores.length ? idx : NO_MORE_DOCS;
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
idx = target;
return idx < scores.length ? idx : NO_MORE_DOCS;
diff --git a/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java b/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
index 36a99b06018..8c164726310 100644
--- a/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
+++ b/src/test/org/apache/lucene/search/TestScoreCachingWrappingScorer.java
@@ -42,25 +42,12 @@ public class TestScoreCachingWrappingScorer extends LuceneTestCase {
return idx == scores.length ? Float.NaN : scores[idx++];
}
- /** @deprecated use {@link #docID()} instead. */
- public int doc() { return doc; }
-
public int docID() { return doc; }
- /** @deprecated use {@link #nextDoc()} instead. */
- public boolean next() throws IOException {
- return nextDoc() != NO_MORE_DOCS;
- }
-
public int nextDoc() throws IOException {
return ++doc < scores.length ? doc : NO_MORE_DOCS;
}
- /** @deprecated use {@link #advance(int)} instead. */
- public boolean skipTo(int target) throws IOException {
- return advance(target) != NO_MORE_DOCS;
- }
-
public int advance(int target) throws IOException {
doc = target;
return doc < scores.length ? doc : NO_MORE_DOCS;