On Fri, 5 Jan 2024 10:13:57 GMT, Pavel Rappo <pra...@openjdk.org> wrote:
>> Jonathan Gibbons has updated the pull request incrementally with one >> additional commit since the last revision: >> >> slight simplication for handling suggestions > > src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java line 680: > >> 678: >> .sorted(Comparator.comparingDouble(Pair::distance)) >> 679: .limit(3) >> 680: .toList(); > > Looking at this copied snippet, I realise that it might not be the best > example I could come up with when introduced that functionality. Have you > seen the actual use here? > https://github.com/openjdk/jdk/blob/3aefd1ce714ad2d51f31b73c73b423c7bb7443ed/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/DocLint.java#L380-L401 > It might work better as it does not limit the list of findings to top 3, a > number which (as we discussed offline) has nothing to do with the distance > threshold of `1.0 / 3`. Thanks; I'll use that code. FWIW, I do think it is worth adding a method in StringUtils to encapsulate that behavior, if we can settle on what the functionality should be. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17274#discussion_r1443125585