mirror of https://github.com/apache/lucene.git
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:
parent
bc8eb54886
commit
4eec6fa204
|
@ -210,6 +210,7 @@ final class DocumentsWriter implements Closeable, Accountable {
|
||||||
infoStream.message("DW", "abort");
|
infoStream.message("DW", "abort");
|
||||||
}
|
}
|
||||||
final int limit = perThreadPool.getActiveThreadStateCount();
|
final int limit = perThreadPool.getActiveThreadStateCount();
|
||||||
|
perThreadPool.setAbort();
|
||||||
for (int i = 0; i < limit; i++) {
|
for (int i = 0; i < limit; i++) {
|
||||||
final ThreadState perThread = perThreadPool.getThreadState(i);
|
final ThreadState perThread = perThreadPool.getThreadState(i);
|
||||||
perThread.lock();
|
perThread.lock();
|
||||||
|
@ -306,6 +307,8 @@ final class DocumentsWriter implements Closeable, Accountable {
|
||||||
// ignore & keep on unlocking
|
// ignore & keep on unlocking
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
perThreadPool.clearAbort();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean anyChanges() {
|
boolean anyChanges() {
|
||||||
|
|
|
@ -17,6 +17,7 @@ package org.apache.lucene.index;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.lucene.util.ThreadInterruptedException;
|
import org.apache.lucene.util.ThreadInterruptedException;
|
||||||
|
import org.apache.lucene.util.ThreadInterruptedException;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -48,6 +48,9 @@ public abstract class FilterScorer extends Scorer {
|
||||||
*/
|
*/
|
||||||
public FilterScorer(Scorer in, Weight weight) {
|
public FilterScorer(Scorer in, Weight weight) {
|
||||||
super(weight);
|
super(weight);
|
||||||
|
if (in == null) {
|
||||||
|
throw new NullPointerException("wrapped Scorer must not be null");
|
||||||
|
}
|
||||||
this.in = in;
|
this.in = in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -372,6 +372,9 @@ public class TestJoinUtil extends LuceneTestCase {
|
||||||
@Override
|
@Override
|
||||||
public Scorer scorer(LeafReaderContext context) throws IOException {
|
public Scorer scorer(LeafReaderContext context) throws IOException {
|
||||||
Scorer fieldScorer = fieldWeight.scorer(context);
|
Scorer fieldScorer = fieldWeight.scorer(context);
|
||||||
|
if (fieldScorer == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
NumericDocValues price = context.reader().getNumericDocValues(priceField);
|
NumericDocValues price = context.reader().getNumericDocValues(priceField);
|
||||||
return new FilterScorer(fieldScorer, this) {
|
return new FilterScorer(fieldScorer, this) {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue