Skip to content

Commit

Permalink
Address reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cfournie committed Jun 12, 2023
1 parent e111cc8 commit b333725
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ Bug Fixes

* GITHUB#12220: Hunspell: disallow hidden title-case entries from compound middle/end

* LUCENE-10181: Restrict GraphTokenStreamFiniteStrings#articulationPointsRecurse recursion depth. (Chris Fournier)

Other
---------------------

Expand Down Expand Up @@ -128,7 +126,9 @@ Optimizations

Bug Fixes
---------------------
(No changes)

* LUCENE-10181: Restrict GraphTokenStreamFiniteStrings#articulationPointsRecurse recursion depth. (Chris Fournier)


Other
---------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ private static void articulationPointsRecurse(
if (d < MAX_RECURSION_LEVEL) {
articulationPointsRecurse(a, t.dest, d + 1, depth, low, parent, visited, points);
} else {
throw new IllegalArgumentException("Exceeded maximum recursion level during graph analysis");
throw new IllegalArgumentException(
"Exceeded maximum recursion level during graph analysis");
}
childCount++;
if (low[t.dest] >= depth[state]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.lucene.util.graph;

import static org.apache.lucene.util.automaton.Operations.MAX_RECURSION_LEVEL;

import java.util.ArrayList;
import java.util.Iterator;
import org.apache.lucene.analysis.TokenStream;
Expand Down Expand Up @@ -677,13 +675,13 @@ public void testLongTokenStreamStackOverflowError() throws Exception {
};

// Add in too many tokens to get a high depth graph
for (int i = 0; i < 1024 * 10; i++) {
for (int i = 0; i < 1024 + 1; i++) {
tokens.add(token("network", 1, 1));
}

TokenStream ts = new CannedTokenStream(tokens.toArray(new Token[0]));
GraphTokenStreamFiniteStrings graph = new GraphTokenStreamFiniteStrings(ts);

assertThrows(IllegalArgumentException.class, () -> graph.articulationPoints());
assertThrows(IllegalArgumentException.class, graph::articulationPoints);
}
}

0 comments on commit b333725

Please sign in to comment.