Check the type of the IndexInput rather than the Directory to detect

native implementation.  This is a simpler and more correct test.  It
also permits the Directory to return a mixture of native and
non-native IndexInput implementations.


git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150604 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Doug Cutting 2004-10-13 17:23:26 +00:00
parent feaea07b3c
commit b2416b3039
1 changed files with 2 additions and 3 deletions

View File

@ -18,7 +18,7 @@ package org.apache.lucene.index;
import java.io.IOException;
import org.apache.lucene.store.GCJDirectory;
import org.apache.lucene.store.GCJIndexInput;
class GCJSegmentReader extends SegmentReader {
@ -26,8 +26,7 @@ class GCJSegmentReader extends SegmentReader {
* implementation can only be used when the segment's directory is a
* GCJDirectory and it is not in compound format. */
public final TermDocs termDocs() throws IOException {
if (directory() instanceof GCJDirectory // it's a GCJ directory
&& this.cfsReader == null) { // & not in compound format
if (freqStream instanceof GCJIndexInput) { // it's a GCJIndexInput
return new GCJTermDocs(this); // so can use GCJTermDocs
} else {
return super.termDocs();