LUCENE-7710: BlockPackedReader now throws CorruptIndexException if bitsPerValue is out of bounds, not generic IOException

This commit is contained in:
Mike McCandless 2017-02-24 17:13:49 -05:00
parent 2e56c0e505
commit cab3aae11d
2 changed files with 6 additions and 1 deletions

View File

@ -178,6 +178,10 @@ Improvements
earlier than regular queries in order to improve cache efficiency.
(Adrien Grand)
* LUCENE-7710: BlockPackedReader throws CorruptIndexException and includes
IndexInput description instead of plain IOException (Mike Drob via
Mike McCandless)
Optimizations
* LUCENE-7641: Optimized point range queries to compute documents that do not

View File

@ -28,6 +28,7 @@ import static org.apache.lucene.util.packed.PackedInts.numBlocks;
import java.io.IOException;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.LongValues;
@ -58,7 +59,7 @@ public final class BlockPackedReader extends LongValues implements Accountable {
final int bitsPerValue = token >>> BPV_SHIFT;
sumBPV += bitsPerValue;
if (bitsPerValue > 64) {
throw new IOException("Corrupted");
throw new CorruptIndexException("Corrupted Block#" + i, in);
}
if ((token & MIN_VALUE_EQUALS_0) == 0) {
if (minValues == null) {