LUCENE-9356: Make FST throw the correct exception upon incorrect input type.

This commit is contained in:
Adrien Grand 2020-06-11 18:21:37 +02:00
parent 2991acf8ff
commit 38adf09ca2
1 changed files with 2 additions and 1 deletions

View File

@ -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();