glawson0 commented on a change in pull request #157: URL: https://github.com/apache/lucene/pull/157#discussion_r643674911
########## File path: lucene/analysis/common/src/java/org/apache/lucene/analysis/core/FlattenGraphFilter.java ########## @@ -193,14 +194,25 @@ private boolean releaseBufferedToken() { } if (inputNode.tokens.size() == 0) { assert inputNode.nextOut == 0; - assert output.nextOut == 0; // Hole dest nodes should never be merged since 1) we always // assign them to a new output position, and 2) since they never // have arriving tokens they cannot be pushed: - assert output.inputNodes.size() == 1 : output.inputNodes.size(); + // skip hole sources, but don't free until every input is checked + if (output.inputNodes.size() > 1) { + output.inputNodes.remove(output.nextOut); + if (output.nextOut < output.inputNodes.size()) { + continue; + } + } + outputFrom++; - inputNodes.freeBefore(output.inputNodes.get(0)); + int freeBefore = Collections.min(output.inputNodes); + assert outputNodes.get(outputFrom).inputNodes.stream().filter(n -> freeBefore < n).count() Review comment: You're correct. The test as written here just checks if at least one node is ok instead of all nodes, then prints the wrong message. -- 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. 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