mirror of https://github.com/apache/lucene.git
add checks
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5178@1515605 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
28316a161c
commit
863c219122
|
@ -608,6 +608,32 @@ public class AssertingAtomicReader extends FilterAtomicReader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Bits getLiveDocs() {
|
||||||
|
Bits liveDocs = super.getLiveDocs();
|
||||||
|
if (liveDocs != null) {
|
||||||
|
assert maxDoc() == liveDocs.length();
|
||||||
|
} else {
|
||||||
|
assert maxDoc() == numDocs();
|
||||||
|
assert !hasDeletions();
|
||||||
|
}
|
||||||
|
return liveDocs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Bits getDocsWithField(String field) throws IOException {
|
||||||
|
Bits docsWithField = super.getDocsWithField(field);
|
||||||
|
FieldInfo fi = getFieldInfos().fieldInfo(field);
|
||||||
|
if (docsWithField != null) {
|
||||||
|
assert fi != null;
|
||||||
|
assert fi.hasDocValues();
|
||||||
|
assert maxDoc() == docsWithField.length();
|
||||||
|
} else {
|
||||||
|
assert fi == null || fi.hasDocValues() == false;
|
||||||
|
}
|
||||||
|
return docsWithField;
|
||||||
|
}
|
||||||
|
|
||||||
// this is the same hack as FCInvisible
|
// this is the same hack as FCInvisible
|
||||||
@Override
|
@Override
|
||||||
public Object getCoreCacheKey() {
|
public Object getCoreCacheKey() {
|
||||||
|
|
Loading…
Reference in New Issue