On Mon, 15 Mar 2021 17:31:10 GMT, Alexey Semenyuk <asemen...@openjdk.org> wrote:

>> This converts jpackage to use `Stream.toList()` instead of 
>> `Stream.collect(Collectors.toList())`. One piece of code was modified to not 
>> mutate a list in addition to one test that used a mutating sort on a list. 
>> The rest of the changes are simple substitutions.
>
> src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java line 
> 151:
> 
>> 149:             components.add(BigInteger.ZERO);
>> 150:         }
>> 151:         return components.stream().toList().toArray(BigInteger[]::new);
> 
> I guess this can be simplified down to 
> `components.stream().toArray(BigInteger[]::new);`

Good catch!

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

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

Reply via email to