diff --git a/lucene/src/test/org/apache/lucene/TestExternalCodecs.java b/lucene/src/test/org/apache/lucene/TestExternalCodecs.java index c0c122e2391..2d5dd27d983 100644 --- a/lucene/src/test/org/apache/lucene/TestExternalCodecs.java +++ b/lucene/src/test/org/apache/lucene/TestExternalCodecs.java @@ -93,7 +93,6 @@ public class TestExternalCodecs extends LuceneTestCase { w.deleteDocuments(new Term("id", "77")); IndexReader r = IndexReader.open(w, true); - IndexReader[] subs = r.getSequentialSubReaders(); assertEquals(NUM_DOCS-1, r.numDocs()); IndexSearcher s = newSearcher(r); diff --git a/lucene/src/test/org/apache/lucene/codecs/lucene3x/TestTermInfosReaderIndex.java b/lucene/src/test/org/apache/lucene/codecs/lucene3x/TestTermInfosReaderIndex.java index 79cdc95b686..7756a11d2fd 100644 --- a/lucene/src/test/org/apache/lucene/codecs/lucene3x/TestTermInfosReaderIndex.java +++ b/lucene/src/test/org/apache/lucene/codecs/lucene3x/TestTermInfosReaderIndex.java @@ -34,6 +34,7 @@ import org.apache.lucene.codecs.preflexrw.PreFlexRWCodec; import org.apache.lucene.document.Document; import org.apache.lucene.document.StringField; import org.apache.lucene.index.CorruptIndexException; +import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.FieldsEnum; import org.apache.lucene.index.IndexFileNames; @@ -93,8 +94,8 @@ public class TestTermInfosReaderIndex extends LuceneTestCase { populate(directory, config); - IndexReader r0 = IndexReader.open(directory); - SegmentReader r = (SegmentReader) r0.getSequentialSubReaders()[0]; + DirectoryReader r0 = IndexReader.open(directory); + SegmentReader r = LuceneTestCase.getOnlySegmentReader(r0); String segment = r.getSegmentName(); r.close();