RFR: JDK-8274639: Provide a way to disable warnings for cross-modular links [v3]

Hannes Wallnöfer hannesw at openjdk.java.net
Wed Nov 10 15:32:14 UTC 2021


On Mon, 8 Nov 2021 19:20:25 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Hannes Wallnöfer has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Improve l10n hint
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties line 457:
> 
>> 455: 
>> 456: doclet.usage.link-modularity-mismatch.parameters=\
>> 457:     (warn|info)
> 
> This is one of those cases where the words "warn" and "info" should *not* be localized, because they are the values accepted by the option -- assuming that those values are not themselves also localized.  I suggest you either add an immediately preceding comment, per the localization guidelines, or else use `({0}|{1})` and provide those strings from the calcite,

Good catch, I wasn't aware of the potential problem. I went with the L10N comment as the code that retrieves the message is the same for all options so passing extra parameters is not easy to do.

> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java line 172:
> 
>> 170:      * True if warnings on external documentation with non-matching modularity should be omitted.
>> 171:      */
>> 172:     private boolean linkModularityNoWarning = false;
> 
> Would it be better to use a local enum that matches the option values?

I introduced an enum, I agree it's an improvement. Hope you are ok with the naming.

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

PR: https://git.openjdk.java.net/jdk/pull/5900


More information about the javadoc-dev mailing list