rmuir commented on a change in pull request #2414:
URL: https://github.com/apache/lucene-solr/pull/2414#discussion_r580238380
##########
File path:
lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Hunspell.java
##########
@@ -540,7 +566,36 @@ boolean acceptsStem(int formID) {
if (word.contains("-") && suggestions.stream().noneMatch(s ->
s.contains("-"))) {
suggestions.addAll(modifyChunksBetweenDashes(word));
}
+ }
+
+ private Runnable checkTimeLimit(String word, WordCase wordCase, Set<String>
suggestions) {
+ return new Runnable() {
+ final long limit = System.nanoTime() +
TimeUnit.MILLISECONDS.toNanos(SUGGEST_TIME_LIMIT);
Review comment:
What happens in the case of overflow here, the javadocs for `nanotime()`
state:
> one should use t1 - t0 < 0, not t1 < t0, because of the possibility of
numerical overflow.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]