You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2020/06/12 07:17:19 UTC
[lucene-solr] 01/02: LUCENE-9356: Make FST throw the correct
exception upon incorrect input type.
This is an automated email from the ASF dual-hosted git repository.
jpountz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 38adf09ca2ba9620940fc279cc12760cc355a361
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Thu Jun 11 18:21:37 2020 +0200
LUCENE-9356: Make FST throw the correct exception upon incorrect input type.
---
lucene/core/src/java/org/apache/lucene/util/fst/FST.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lucene/core/src/java/org/apache/lucene/util/fst/FST.java b/lucene/core/src/java/org/apache/lucene/util/fst/FST.java
index 260e9da..d092850 100644
--- a/lucene/core/src/java/org/apache/lucene/util/fst/FST.java
+++ b/lucene/core/src/java/org/apache/lucene/util/fst/FST.java
@@ -26,6 +26,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import org.apache.lucene.codecs.CodecUtil;
+import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.store.ByteBuffersDataOutput;
import org.apache.lucene.store.DataInput;
import org.apache.lucene.store.DataOutput;
@@ -452,7 +453,7 @@ public final class FST<T> implements Accountable {
inputType = INPUT_TYPE.BYTE4;
break;
default:
- throw new IllegalStateException("invalid input type " + t);
+ throw new CorruptIndexException("invalid input type " + t, in);
}
startNode = in.readVLong();