On Fri, 5 Jan 2024 09:45:34 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 461:
> 
>> 459:                 result = ERROR;
>> 460:             }
>> 461:             log.flush();
> 
> Why is this flush needed here? There's already one, two lines below.

It's needed before the line that follows, to report the warning and error 
count. Without it, the "did you mean..." lines come after the error count info.

> src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java line 683:
> 
>> 681:         switch (suggestions.size()) {
>> 682:             case 0 -> { }
>> 683:             case 1 -> showLinesUsingKey("main.did-you-mean", 
>> suggestions.get(0).word);
> 
> Consider `suggestions.getFirst()` instead of `suggestions.get(0)`.

I like `.getFirst`. I may also rename the somewhat generic `Pair` to 
`Suggestion`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17274#discussion_r1443121756
PR Review Comment: https://git.openjdk.org/jdk/pull/17274#discussion_r1443122652

Reply via email to