mirror of https://github.com/apache/lucene.git
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:
parent
feaea07b3c
commit
b2416b3039
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue