FilterScorer's wrapped Scorer input should not be null

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1690928 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-07-14 13:32:47 +00:00
parent bc8eb54886
commit 4eec6fa204
4 changed files with 10 additions and 0 deletions

View File

@ -210,6 +210,7 @@ final class DocumentsWriter implements Closeable, Accountable {
infoStream.message("DW", "abort");
}
final int limit = perThreadPool.getActiveThreadStateCount();
perThreadPool.setAbort();
for (int i = 0; i < limit; i++) {
final ThreadState perThread = perThreadPool.getThreadState(i);
perThread.lock();
@ -306,6 +307,8 @@ final class DocumentsWriter implements Closeable, Accountable {
// ignore & keep on unlocking
}
}
perThreadPool.clearAbort();
}
boolean anyChanges() {

View File

@ -17,6 +17,7 @@ package org.apache.lucene.index;
*/
import org.apache.lucene.util.ThreadInterruptedException;
import org.apache.lucene.util.ThreadInterruptedException;
import java.util.ArrayList;
import java.util.List;

View File

@ -48,6 +48,9 @@ public abstract class FilterScorer extends Scorer {
*/
public FilterScorer(Scorer in, Weight weight) {
super(weight);
if (in == null) {
throw new NullPointerException("wrapped Scorer must not be null");
}
this.in = in;
}

View File

@ -372,6 +372,9 @@ public class TestJoinUtil extends LuceneTestCase {
@Override
public Scorer scorer(LeafReaderContext context) throws IOException {
Scorer fieldScorer = fieldWeight.scorer(context);
if (fieldScorer == null) {
return null;
}
NumericDocValues price = context.reader().getNumericDocValues(priceField);
return new FilterScorer(fieldScorer, this) {
@Override