LUCENE-2769: FilterIndexReader in trunk does not implement getSequentialSubReaders() correctly

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1036977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2010-11-19 18:49:54 +00:00
parent 24178a6eb8
commit 7a86d09aea
3 changed files with 9 additions and 4 deletions

View File

@ -279,7 +279,7 @@ public class FilterIndexReader extends IndexReader {
@Override
public Bits getDeletedDocs() {
return MultiFields.getDeletedDocs(in);
return in.getDeletedDocs();
}
@Override
@ -415,12 +415,12 @@ public class FilterIndexReader extends IndexReader {
@Override
public IndexReader[] getSequentialSubReaders() {
return null;
return in.getSequentialSubReaders();
}
@Override
public Fields fields() throws IOException {
return MultiFields.getFields(in);
return in.fields();
}
/** If the subclass of FilteredIndexReader modifies the

View File

@ -82,4 +82,9 @@ public final class SlowMultiReaderWrapper extends FilterIndexReader {
public void doClose() throws IOException {
throw new UnsupportedOperationException("please call close on the original reader instead");
}
@Override
public IndexReader[] getSequentialSubReaders() {
return null;
}
}

View File

@ -149,7 +149,7 @@ public class TestFilterIndexReader extends LuceneTestCase {
//IndexReader reader = new TestReader(IndexReader.open(directory, true));
Directory target = newDirectory();
writer = new IndexWriter(target, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer()));
IndexReader reader = new TestReader(IndexReader.open(directory, true));
IndexReader reader = new TestReader(SlowMultiReaderWrapper.wrap(IndexReader.open(directory, true)));
writer.addIndexes(reader);
writer.close();
reader.close();