Disable optimized implementation with compound format.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150562 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Doug Cutting 2004-10-04 19:05:05 +00:00
parent 7fec8b5ff9
commit 07c48aa589
1 changed files with 6 additions and 2 deletions

View File

@ -22,9 +22,13 @@ import org.apache.lucene.store.GCJDirectory;
class GCJSegmentReader extends SegmentReader {
/** Try to use an optimized native implementation of TermDocs. The optimized
* 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) {
return new GCJTermDocs(this);
if (directory() instanceof GCJDirectory // it's a GCJ directory
&& this.cfsReader == null) { // & not in compound format
return new GCJTermDocs(this); // so can use GCJTermDocs
} else {
return super.termDocs();
}