Skip to content

Commit

Permalink
LUCENE-9356: Make FST throw the correct exception upon incorrect inpu…
Browse files Browse the repository at this point in the history
…t type.
  • Loading branch information
jpountz committed Jun 12, 2020
1 parent 2991acf commit 38adf09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lucene/core/src/java/org/apache/lucene/util/fst/FST.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
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;
Expand Down Expand Up @@ -452,7 +453,7 @@ public FST(DataInput in, Outputs<T> outputs, FSTStore fstStore) throws IOExcepti
inputType = INPUT_TYPE.BYTE4;
break;
default:
throw new IllegalStateException("invalid input type " + t);
throw new CorruptIndexException("invalid input type " + t, in);
}
startNode = in.readVLong();

Expand Down

0 comments on commit 38adf09

Please sign in to comment.