Index: lucene/CHANGES.txt =================================================================== --- lucene/CHANGES.txt (revision 1056995) +++ lucene/CHANGES.txt (working copy) @@ -131,6 +131,9 @@ * LUCENE-2837: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to operate on a ReaderContext instead of directly on IndexReader to enable searches to be aware of IndexSearcher's context. (Simon Willnauer) + +* LUCENE-2839: Scorer#score(Collector,int,int) is now public because it is + called from other classes and part of public API. (Uwe Schindler) Changes in Runtime Behavior Index: lucene/src/java/org/apache/lucene/search/BooleanScorer.java =================================================================== --- lucene/src/java/org/apache/lucene/search/BooleanScorer.java (revision 1056995) +++ lucene/src/java/org/apache/lucene/search/BooleanScorer.java (working copy) @@ -229,7 +229,7 @@ // firstDocID is ignored since nextDoc() initializes 'current' @Override - protected boolean score(Collector collector, int max, int firstDocID) throws IOException { + public boolean score(Collector collector, int max, int firstDocID) throws IOException { boolean more; Bucket tmp; BucketScorer bs = new BucketScorer(); Index: lucene/src/java/org/apache/lucene/search/BooleanScorer2.java =================================================================== --- lucene/src/java/org/apache/lucene/search/BooleanScorer2.java (revision 1056995) +++ lucene/src/java/org/apache/lucene/search/BooleanScorer2.java (working copy) @@ -280,7 +280,7 @@ } @Override - protected boolean score(Collector collector, int max, int firstDocID) throws IOException { + public boolean score(Collector collector, int max, int firstDocID) throws IOException { doc = firstDocID; collector.setScorer(this); while (doc < max) { Index: lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java =================================================================== --- lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java (revision 1056995) +++ lucene/src/java/org/apache/lucene/search/ConstantScoreQuery.java (working copy) @@ -244,10 +244,8 @@ } // this optimization allows out of order scoring as top scorer, - // TODO: theoretically this method should not be called because its protected and - // this class does not use it, it should be public in Scorer! @Override - protected boolean score(Collector collector, int max, int firstDocID) throws IOException { + public boolean score(Collector collector, int max, int firstDocID) throws IOException { if (docIdSetIterator instanceof Scorer) { return ((Scorer) docIdSetIterator).score(wrapCollector(collector), max, firstDocID); } else { Index: lucene/src/java/org/apache/lucene/search/DisjunctionSumScorer.java =================================================================== --- lucene/src/java/org/apache/lucene/search/DisjunctionSumScorer.java (revision 1056995) +++ lucene/src/java/org/apache/lucene/search/DisjunctionSumScorer.java (working copy) @@ -123,7 +123,7 @@ * @return true if more matching documents may remain. */ @Override - protected boolean score(Collector collector, int max, int firstDocID) throws IOException { + public boolean score(Collector collector, int max, int firstDocID) throws IOException { // firstDocID is ignored since nextDoc() sets 'currentDoc' collector.setScorer(this); while (currentDoc < max) { Index: lucene/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java =================================================================== --- lucene/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java (revision 1056995) +++ lucene/src/java/org/apache/lucene/search/ScoreCachingWrappingScorer.java (working copy) @@ -43,7 +43,7 @@ } @Override - protected boolean score(Collector collector, int max, int firstDocID) throws IOException { + public boolean score(Collector collector, int max, int firstDocID) throws IOException { return scorer.score(collector, max, firstDocID); } Index: lucene/src/java/org/apache/lucene/search/Scorer.java =================================================================== --- lucene/src/java/org/apache/lucene/search/Scorer.java (revision 1056995) +++ lucene/src/java/org/apache/lucene/search/Scorer.java (working copy) @@ -90,7 +90,7 @@ * this method. * @return true if more matching documents may remain. */ - protected boolean score(Collector collector, int max, int firstDocID) throws IOException { + public boolean score(Collector collector, int max, int firstDocID) throws IOException { collector.setScorer(this); int doc = firstDocID; while (doc < max) { Index: lucene/src/java/org/apache/lucene/search/TermScorer.java =================================================================== --- lucene/src/java/org/apache/lucene/search/TermScorer.java (revision 1056995) +++ lucene/src/java/org/apache/lucene/search/TermScorer.java (working copy) @@ -77,7 +77,7 @@ // firstDocID is ignored since nextDoc() sets 'doc' @Override - protected boolean score(Collector c, int end, int firstDocID) throws IOException { + public boolean score(Collector c, int end, int firstDocID) throws IOException { c.setScorer(this); while (doc < end) { // for docs in window c.collect(doc); // collect score Index: lucene/src/test/org/apache/lucene/search/JustCompileSearch.java =================================================================== --- lucene/src/test/org/apache/lucene/search/JustCompileSearch.java (revision 1056995) +++ lucene/src/test/org/apache/lucene/search/JustCompileSearch.java (working copy) @@ -215,7 +215,7 @@ } @Override - protected boolean score(Collector collector, int max, int firstDocID) + public boolean score(Collector collector, int max, int firstDocID) throws IOException { throw new UnsupportedOperationException(UNSUPPORTED_MSG); }