dungba88 commented on code in PR #12624: URL: https://github.com/apache/lucene/pull/12624#discussion_r1400638946
########## lucene/core/src/java/org/apache/lucene/util/fst/FSTCompiler.java: ########## @@ -153,6 +176,34 @@ private FSTCompiler( } } + // Get the respective FSTReader of the DataOutput. If the DataOutput is also a FSTReader then we + // will use it. Otherwise, we will use NullFSTReader, which does not allow reading. + private FSTReader toFSTReader(DataOutput dataOutput) { + if (dataOutput instanceof FSTReader) { + return (FSTReader) dataOutput; + } + return new NullFSTReader(); Review Comment: We still need to pass a `FSTReader` to the FST constructor. The `NullFSTReader` is for when using a non-FSTReader DataOutput, like IndexOutput. There are 2 ways: - Using a `NullFSTReader` like this. - Pass actual null and do null-check/throw on FST itself. Ok let me try the second approach -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org