On Wed, 8 Nov 2023 17:37:25 GMT, Pavel Rappo <pra...@openjdk.org> wrote:

>> Jonathan Gibbons has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Fix whitespace
>
> 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16388#discussion_r1393484918

Reply via email to