RFR: JDK-8275788: Create code element with suitable attributes for code snippets [v3]
Jonathan Gibbons
jjg at openjdk.java.net
Fri Oct 29 16:04:26 UTC 2021
On Fri, 29 Oct 2021 15:43:02 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>>> > `Utils.toLowerCase` is the right way.
>>>
>>> Some parts of jdk.javadoc reach to jdk.compiler for StringUtils.toLowerCase(String). Smells like cleanup.
>>
>> Yes. javadoc is complicated.
>>
>> Architecturally, the "tool" part of `javadoc` inherently has direct access to `javac` and its internals, and structurally, does not have access to `Utils`. Conversely, the "doclets" world does not (should not) need to access `javac` internals, and so should use `Utils` instead.
>>
>> In a different world, with smaller modules, the tool would be in one module, and the doclets world would be in one or more different modules.
>
> On the filename extension mapping...
>
> * I agree with @pavelrappo that the mapping seems out of place here
> * I agree with @hns that the mapping is convenient and mostly stable
>
> To me, the mapping feels like the contents of a `.properties` file, probably read as a resource file. Then, (perhaps later?) we can investigate ways to augment or override the contents of the resource file, using some combination of class path magic, system properties, or command-line options.
If you build the mapping into the code (either in Java or in a resource file) you probably should document/specify the list somewhere.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6165
More information about the javadoc-dev
mailing list