LUCENE-970: FilterIndexReader now implements isOptimized().

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@561162 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Busch 2007-07-30 22:29:56 +00:00
parent f3b9c9407a
commit 4b11c35b08
3 changed files with 10 additions and 0 deletions

View File

@ -54,6 +54,9 @@ Bug fixes
in case the index has multiple segments. The public MultiReader
now extends MultiSegmentReader and is intended to be used by users
who want to add their own subreaders. (Daniel Naber, Michael Busch)
8. LUCENE-970: FilterIndexReader now implements isOptimized(). Before
a call of isOptimized() would throw a NPE. (Michael Busch)
New features

View File

@ -217,4 +217,9 @@ public class FilterIndexReader extends IndexReader {
ensureOpen();
return in.isCurrent();
}
public boolean isOptimized() {
ensureOpen();
return in.isOptimized();
}
}

View File

@ -112,6 +112,8 @@ public class TestFilterIndexReader extends TestCase {
IndexReader reader = new TestReader(IndexReader.open(directory));
assertTrue(reader.isOptimized());
TermEnum terms = reader.terms();
while (terms.next()) {
assertTrue(terms.term().text().indexOf('e') != -1);