remove dead code, take 2

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@981696 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-08-02 22:10:41 +00:00
parent daeafbacf2
commit 022d7d2fe4
3 changed files with 9 additions and 14 deletions

View File

@ -186,12 +186,6 @@ final class FieldsReader implements Cloneable {
indexStream.seek(FORMAT_SIZE + (docID + docStoreOffset) * 8L);
}
boolean canReadRawDocs() {
// Since we currently only support >3.0 format anymore, always return true!
// I leave this method in because it may help for later format changes.
return true;
}
final Document doc(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException {
seekIndex(n);
long position = indexStream.readLong();

View File

@ -321,7 +321,7 @@ final class SegmentMerger {
FieldsReader matchingFieldsReader = null;
if (matchingSegmentReader != null) {
final FieldsReader fieldsReader = matchingSegmentReader.getFieldsReader();
if (fieldsReader != null && fieldsReader.canReadRawDocs()) {
if (fieldsReader != null) {
matchingFieldsReader = fieldsReader;
}
}

View File

@ -104,8 +104,12 @@ class TermVectorsReader implements Cloneable {
// docs
assert numTotalDocs >= size + docStoreOffset: "numTotalDocs=" + numTotalDocs + " size=" + size + " docStoreOffset=" + docStoreOffset;
}
} else
} else {
// TODO: understand why FieldInfos.hasVectors() can
// return true yet the term vectors files don't
// exist...
format = 0;
}
this.fieldInfos = fieldInfos;
success = true;
@ -136,7 +140,9 @@ class TermVectorsReader implements Cloneable {
}
boolean canReadRawDocs() {
return format >= FORMAT_UTF8_LENGTH_IN_BYTES;
// we can always read raw docs, unless the term vectors
// didn't exist
return format != 0;
}
/** Retrieve the length (in bytes) of the tvd and tvf
@ -153,11 +159,6 @@ class TermVectorsReader implements Cloneable {
return;
}
// SegmentMerger calls canReadRawDocs() first and should
// not call us if that returns false.
if (format < FORMAT_UTF8_LENGTH_IN_BYTES)
throw new IllegalStateException("cannot read raw docs with older term vector formats");
seekTvx(startDocID);
long tvdPosition = tvx.readLong();