You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2017/02/24 22:15:00 UTC

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

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x d00c5cae2 -> e903f69ab


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


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e903f69a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e903f69a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e903f69a

Branch: refs/heads/branch_6x
Commit: e903f69ab31384b5af17e38e2257dca4bee5a673
Parents: d00c5ca
Author: Mike McCandless <mi...@apache.org>
Authored: Fri Feb 24 17:13:49 2017 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Fri Feb 24 17:14:25 2017 -0500

----------------------------------------------------------------------
 lucene/CHANGES.txt                                               | 4 ++++
 .../java/org/apache/lucene/util/packed/BlockPackedReader.java    | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e903f69a/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 945d009..9681b6f 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -118,6 +118,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

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e903f69a/lucene/core/src/java/org/apache/lucene/util/packed/BlockPackedReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/BlockPackedReader.java b/lucene/core/src/java/org/apache/lucene/util/packed/BlockPackedReader.java
index 82bf93f..986cba7 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/BlockPackedReader.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/BlockPackedReader.java
@@ -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) {