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/11 16:25:56 UTC

[lucene-solr] branch branch_8x updated: 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 branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 8d95a2e  LUCENE-9356: Make FST throw the correct exception upon incorrect input type.
8d95a2e is described below

commit 8d95a2ee582da04edf419e6b39756fdde55503fc
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 18fcf65..b6d327f 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.DataInput;
 import org.apache.lucene.store.DataOutput;
 import org.apache.lucene.store.InputStreamDataInput;
@@ -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();