On Sun, 14 Mar 2021 18:22:50 GMT, Ian Graves <igra...@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. Looks good. Minor improvements suggested. src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java line 200: > 198: ).map(e -> { > 199: e.getValue().setOutputFileName(e.getKey()); > 200: return (WixFragmentBuilder) e.getValue(); Why this explicit cast is needed here? 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);` ------------- PR: https://git.openjdk.java.net/jdk/pull/2997