> I am using lucene 2.9 and I can't understand why a succession of
> un-deprecated methods calls a deprecated method in this class.
> The series of calls is as follows:
> 
> Searcher.search(Query, Collector)
> IndexSearcher.search(Weight, Filter, Collector)
> Scorer.score(Collector)
> DocIdSetIterator.nextDoc()
> DocIdSetIterator.next()
> 
> The javadocs for next() say that you should call nextDoc() but yet the
> nextDoc() method calls next()!

This is he correct behavior for deprecating methods that are intended to be 
overridden by users (in this case abstract ones - abstract in 2.4). The reason 
behind is:

If you have legacy 2.4 code that is not yet updated to use nextDoc(), but only 
overrided the previously abstract next(), the backwards layer in the default 
implementation of DocIdSetIterator calls next() for you, so the old code still 
works. If you have code that is already on 3.0 or 2.9 stage, you will override 
nextDoc() and next() is never used.

The nextDoc() -> next() is therefore only called, when you have an 2.4 legacy 
class.

Uwe


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to