LUCENE-4086: remove 3.x cruft

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1348907 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-06-11 15:32:34 +00:00
parent cda03034d0
commit b7a1c626dc
2 changed files with 4 additions and 12 deletions

View File

@ -345,11 +345,7 @@ final class SegmentMerger {
private void mergePerDoc(SegmentWriteState segmentWriteState) throws IOException { private void mergePerDoc(SegmentWriteState segmentWriteState) throws IOException {
final PerDocConsumer docsConsumer = codec.docValuesFormat() final PerDocConsumer docsConsumer = codec.docValuesFormat()
.docsConsumer(new PerDocWriteState(segmentWriteState)); .docsConsumer(new PerDocWriteState(segmentWriteState));
// TODO: remove this check when 3.x indexes are no longer supported assert docsConsumer != null;
// (3.x indexes don't have docvalues)
if (docsConsumer == null) {
return;
}
boolean success = false; boolean success = false;
try { try {
docsConsumer.merge(mergeState); docsConsumer.merge(mergeState);
@ -366,11 +362,7 @@ final class SegmentMerger {
private void mergeNorms(SegmentWriteState segmentWriteState) throws IOException { private void mergeNorms(SegmentWriteState segmentWriteState) throws IOException {
final PerDocConsumer docsConsumer = codec.normsFormat() final PerDocConsumer docsConsumer = codec.normsFormat()
.docsConsumer(new PerDocWriteState(segmentWriteState)); .docsConsumer(new PerDocWriteState(segmentWriteState));
// TODO: remove this check when 3.x indexes are no longer supported assert docsConsumer != null;
// (3.x indexes don't have docvalues)
if (docsConsumer == null) {
return;
}
boolean success = false; boolean success = false;
try { try {
docsConsumer.merge(mergeState); docsConsumer.merge(mergeState);

View File

@ -73,8 +73,8 @@ public class BM25Similarity extends Similarity {
} }
/** The default implementation computes the average as <code>sumTotalTermFreq / maxDoc</code>, /** The default implementation computes the average as <code>sumTotalTermFreq / maxDoc</code>,
* or returns <code>1</code> if the index does not store sumTotalTermFreq (Lucene 3.x indexes * or returns <code>1</code> if the index does not store sumTotalTermFreq:
* or any field that omits frequency information). */ * any field that omits frequency information). */
protected float avgFieldLength(CollectionStatistics collectionStats) { protected float avgFieldLength(CollectionStatistics collectionStats) {
final long sumTotalTermFreq = collectionStats.sumTotalTermFreq(); final long sumTotalTermFreq = collectionStats.sumTotalTermFreq();
if (sumTotalTermFreq <= 0) { if (sumTotalTermFreq <= 0) {