Skip to content

Commit 04f38dd

Browse files
dungba88Anh Dung Bui
andauthored
Move addNode to FSTCompiler (#12646)
Currently FSTCompiler and FST have circular dependencies to each other. FSTCompiler creates an instance of FST, and on adding node (add(IntsRef input, T output)), it delegates to FST.addNode() and passes itself as a variable. This introduces a circular dependency and mixes up the FST constructing and traversing code. To make matter worse, this implies one can call FST.addNode with an arbitrary FSTCompiler (as it's a parameter), but in reality it should be the compiler which creates the FST. This commit moves the addNode method to FSTCompiler instead. Co-authored-by: Anh Dung Bui <[email protected]>
1 parent 65d2227 commit 04f38dd

File tree

5 files changed

+420
-425
lines changed

5 files changed

+420
-425
lines changed

lucene/CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ API Changes
143143
* GITHUB#12592: Add RandomAccessInput#length method to the RandomAccessInput interface. In addition deprecate
144144
ByteBuffersDataInput#size in favour of this new method. (Ignacio Vera)
145145

146+
* GITHUB#12646: Move FST#addNode to FSTCompiler to avoid a circular dependency between FST and FSTCompiler
146147

147148
New Features
148149
---------------------

0 commit comments

Comments
 (0)