RFR: JDK-8298405: Support Markdown in Documentation Comments [v28]
Pavel Rappo
prappo at openjdk.org
Fri Feb 9 19:05:13 UTC 2024
On Wed, 15 Nov 2023 00:37:06 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> test/langtools/jdk/javadoc/tool/testTransformer/TestTransformer.java line 96:
>>
>>> 94: var sl = ServiceLoader.load(DocTrees.DocCommentTreeTransformer.class);
>>> 95: return StreamSupport.stream(sl.spliterator(), false)
>>> 96: .filter(p -> p.name().equals(name))
>>
>> ServiceLoader specification suggests another way of streaming:
>> Suggestion:
>>
>> return sl.stream()
>> .map(ServiceLoader.Provider::get)
>> .filter(t -> t.name().equals(name))
>>
>> Would it be the same and more readable?
>
> Hmm. It's longer, but arguably simpler to comprehend than using a spliterator. I've changed the code.
There's now a leftover `import java.util.stream.StreamSupport;` in that file.
>> test/langtools/tools/javac/doctree/MDPrinter.java line 67:
>>
>>> 65: * Conceptually based on javac's {@code DPrinter}.
>>> 66: */
>>> 67: public class MDPrinter {
>>
>> While DPrinter is used, MDPrinter isn't. (At least, I could't find any usages of it.) If you feel like MDPrinter is important, we should at least add a compile test for it, to protect it from bitrot.
>
> 👍
MDPrinter.java is now a test that compiles itself; thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1484541756
PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1484196535
More information about the build-dev
mailing list